ansible proxmox scripts
- Shell 54.9%
- Jinja 37.6%
- Python 6.8%
- HTML 0.5%
- Dockerfile 0.2%
- getting_started.sh: alle 8 playbooks toegevoegd aan het menu, inclusief combinatie-opties (alles, alleen WordPress, alleen Docker) en SSH-test - 05_setup_monitoring.sh: LXC IPs gecorrigeerd van 6 naar 3 (101-103), WordPress VM targets (201-203) en Docker host targets (211-213) toegevoegd Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| docs | ||
| inventory | ||
| playbooks | ||
| roles | ||
| scripts | ||
| ansible.cfg | ||
| README.md | ||
| requirements.yml | ||
Proxmox HA Cluster — Ansible Automatisering
Dit project bevat alle Ansible playbooks voor het opzetten van een 3-node Proxmox HA cluster met WordPress, Docker Swarm en monitoring. Alles is geautomatiseerd — van cluster-inrichting tot WordPress-installatie en Docker Swarm met Portainer.
Leeswijzers (opdracht → implementatie)
| Opdracht | Leeswijzer |
|---|---|
| Deel 1: Proxmox cluster + WordPress | docs/leeswijzer-proxmox.md |
| Deel 2: Docker lessons + Swarm | docs/leeswijzer-docker.md |
Wat er in zit
Infrastructuur
- 3-node Proxmox cluster met Ceph shared storage
- Proxmox HA voor automatisch herstarten van VMs bij node-uitval
- No-subscription repositories (geen enterprise licentie nodig)
WordPress (6 servers)
- 3 LXC containers voor Klant 1 (10.24.53.101–103)
- 3 Ubuntu VMs voor Klant 2 met HA (10.24.53.201–203)
- Elke server: 1 core / 1 GB RAM / 30 GB disk / max 50 MB/s netwerk
- Proxmox firewall + UFW per server
- Eigen SSH-gebruiker met key per klantgroep
Docker (3 VMs)
- 1 Ubuntu VM per Proxmox node (10.24.53.211–213)
- Docker Engine + Compose op alle drie
- Docker Swarm: 3 manager-nodes
- Portainer als centrale beheer-UI
- Traefik quick-start (Opdracht 3 deel 1)
- Nginx load balancer voor WordPress VMs
Monitoring
- Prometheus + Grafana op dino1
- Auto-discovery van alle VMs en LXC's via pve-discover.py
- node_exporter op alle servers
Semaphore
- Ansible UI op dino1:3001
- Alle 8 playbooks als klikbare taak beschikbaar
Projectstructuur
playbooks/ # Hoofd-playbooks (1 per taak)
roles/ # Ansible rollen
proxmox/ # Cluster setup, repos, SSH keys
ceph/ # Ceph storage
monitoring/ # Prometheus, Grafana, pve-discover
wordpress/ # LXC + VM aanmaken, WordPress installeren
docker/ # Docker, Swarm, Traefik, Portainer
nginx/ # Nginx reverse proxy + load balancer
semaphore/ # Semaphore Ansible UI
inventory/
hosts.yml # Alle hosts en groepen
docs/
leeswijzer-proxmox.md
leeswijzer-docker.md
opdracht-2-docker-subnetten.md
opdracht-3-reverse-proxy-nginx.md
Uitrollen
Voer de playbooks in volgorde uit:
# 1. Proxmox cluster inrichten
ansible-playbook playbooks/proxmox_setup.yml
# 2. Ceph shared storage
ansible-playbook playbooks/ceph_setup.yml
# 3. Monitoring (Prometheus + Grafana)
ansible-playbook playbooks/monitoring.yml
# 4. WordPress servers aanmaken (LXC + VMs in Proxmox)
ansible-playbook playbooks/wordpress_lxc.yml
# 5. WordPress stack installeren in de VMs
ansible-playbook playbooks/wordpress_vm.yml
# 6. Docker VMs + Swarm + Portainer + Traefik
ansible-playbook playbooks/docker_lessons.yml
# 7. Nginx reverse proxy voor WordPress
ansible-playbook playbooks/reverse_proxy.yml
# 8. Semaphore UI
ansible-playbook playbooks/semaphore.yml
Of alles via Semaphore UI op http://10.24.53.2:3001.
Toegang
| Service | URL | Login |
|---|---|---|
| Proxmox cluster | https://10.24.53.2:8006 |
root |
| Grafana | http://10.24.53.2:3000 |
admin |
| Prometheus | http://10.24.53.2:9090 |
— |
| Semaphore | http://10.24.53.2:3001 |
admin / Admin@Semaphore2024! |
| WordPress Klant 1 (LXC) | http://10.24.53.101–103/wordpress |
— |
| WordPress Klant 2 (VM) | http://10.24.53.201–203/wordpress |
— |
| Nginx (LB voor WordPress) | https://10.24.53.211 |
— |
| Portainer | http://10.24.53.211:9000 |
admin / Admin@Proxmox1! |
| Traefik dashboard | http://10.24.53.211:7880/dashboard/ |
— |
| Lesson 7 container | http://10.24.53.211:8888 |
— |
| Lesson 8 Compose | http://10.24.53.211:8080 |
— |
Vereisten
- Ansible-controller met
id_ed25519SSH-key (Ansible LXC op 388397-LXC) - Drie Proxmox nodes: dino1 (10.24.53.2), dino2 (10.24.53.3), dino3 (10.24.53.4)
- Extra schijf per node voor Ceph OSD's
- Internettoegang voor cloud-images en Docker packages