Date de création : 2026-06-28
Statut : Prêt à déployer
Ce runbook décrit le processus d'intégration automatique d'une nouvelle machine dans l'infrastructure. L'onboarding gère :
Depuis infra-mgmt (192.168.202.50) :
cd /opt/ansible/repo/ansible/scripts
./onboard-machine.sh
Le script pose les questions interactivement. Ou en non-interactif :
./onboard-machine.sh \
--name mon-service \
--ip 192.168.202.55 \
--type LXC \
--role "Serveur web Nginx" \
--ports "80,443" \
--critical false \
--proxmox-id 130 \
--user root \
--group lxc
http://192.168.202.9:5678/form/onboard# Depuis pve-main
pct clone 9000 <ID> --hostname <nom> --full \
--storage Compute-VM-1Terra \
--net0 name=eth0,bridge=vmbr0,ip=192.168.202.XX/24,gw=192.168.202.254
pct start <ID>
# Depuis infra-mgmt
./onboard-machine.sh --name <nom> --ip 192.168.202.XX --skip-ansible
Depuis le PC local :
cd /opt/ansible/repo
ansible-playbook ansible/playbooks/04-create-template.yml
Cela crée le template ID 9000 avec :
ansible/scripts/n8n-onboard-workflow.jsonL'URL du formulaire sera : http://192.168.202.9:5678/form/onboard
Après un onboarding, vérifier :
| Composant | Vérification | URL |
|---|---|---|
| Prometheus | Target UP dans /targets | http://192.168.202.50:9090/targets |
| Grafana | Machine visible dans le dashboard | http://192.168.202.50:3000 |
| Uptime Kuma | Monitors créés et verts | http://192.168.202.51:3001 |
| Wiki.js | Machine dans la page services | http://192.168.202.50:3002/docs/inventaire/services |
| Git | Commit visible sur GitHub | https://github.com/sylexozorus/infrastructure |
| Problème | Cause probable | Solution |
|---|---|---|
| SSH timeout | Machine pas encore démarrée ou IP incorrecte | Vérifier ping <IP>, attendre le boot |
| node_exporter déjà installé | Machine créée depuis le template | Normal, le playbook skip |
| Prometheus target DOWN | Pare-feu bloque le port 9100 | ufw allow 9100 sur la machine |
| Uptime Kuma API erreur | API pas activée ou auth requise | Vérifier settings Uptime Kuma |
| Git push échoue | Pas de credentials Git sur infra-mgmt | Configurer le token GitHub |
| Option | Description |
|---|---|
--dry-run |
Affiche ce qui serait fait sans exécuter |
--skip-ansible |
Ne lance pas le playbook (utile si template déjà configuré) |
--skip-git |
Ne commit/push pas (pour tester) |
--become |
Active sudo (pour users non-root) |