2026-06-21 15:13:45 -04:00
SHELL := /usr/bin/env bash
export ANSIBLE_HOME ?= $( CURDIR) /.ansible
export ANSIBLE_LOCAL_TEMP ?= $( CURDIR) /.ansible/tmp
export ANSIBLE_SSH_CONTROL_PATH_DIR ?= $( CURDIR) /.ansible/cp
export ANSIBLE_SSH_ARGS ?= -F /dev/null -o ControlMaster = no
INVENTAIRE_LAB ?= inventories/lab/hosts.yml
INVENTAIRE_PRODUCTION ?= inventories/production/hosts.yml
FICHIER_INVENTAIRE ?= $( INVENTAIRE_PRODUCTION)
2026-06-21 21:31:03 -04:00
FICHIER_DEPENDANCES ?= docs/dependances-groupes.yml
2026-06-21 15:13:45 -04:00
GROUPE_MODELE ?= modeles_vm
GROUPE_DEBIAN ?= serveurs_debian
2026-06-21 20:35:03 -04:00
GROUPE_HOTES_ACTIFS ?= hotes_actifs
2026-06-21 15:13:45 -04:00
LIMITE ?= $( GROUPE_DEBIAN)
HOTE ?=
ADRESSE_IP ?=
GROUPES ?= $( GROUPE_DEBIAN)
GROUPE ?= $( GROUPE_DEBIAN)
UTILISATEUR_ANSIBLE ?= ansible
VMID_MODELE ?=
VMID ?=
NOEUD_PROXMOX ?=
STOCKAGE_PROXMOX ?=
FORMAT_DISQUE ?=
TAILLE_DISQUE ?=
DISQUE_PROXMOX ?=
CIDR ?= 24
PASSERELLE ?=
DNS ?=
DHCP ?= false
CIUSER ?=
CLE_SSH_PUBLIQUE ?=
PONT_PROXMOX ?=
VLAN ?=
DEMARRER ?=
CLONE_COMPLET ?=
CONFIRMER ?= false
VERIFICATION ?= false
DIFF ?= false
ETIQUETTES ?=
SAUTER_ETIQUETTES ?=
VARIABLES ?=
OPTIONS_PLAYBOOK :=
i f n e q ( $( LIMITE ) , )
OPTIONS_PLAYBOOK += --limit $( LIMITE)
e n d i f
i f e q ( $( VERIFICATION ) , t r u e )
OPTIONS_PLAYBOOK += --check
e n d i f
i f e q ( $( DIFF ) , t r u e )
OPTIONS_PLAYBOOK += --diff
e n d i f
i f n e q ( $( ETIQUETTES ) , )
OPTIONS_PLAYBOOK += --tags $( ETIQUETTES)
e n d i f
i f n e q ( $( SAUTER_ETIQUETTES ) , )
OPTIONS_PLAYBOOK += --skip-tags $( SAUTER_ETIQUETTES)
e n d i f
i f n e q ( $( VARIABLES ) , )
OPTIONS_PLAYBOOK += -e $( VARIABLES)
e n d i f
PLAYBOOK_PREPARER_MODELE := playbooks/modeles_vm/debian13_proxmox_preparer.yml
PLAYBOOK_VERIFIER_MODELE := playbooks/modeles_vm/debian13_proxmox_verifier.yml
PLAYBOOK_NETTOYER_MODELE := playbooks/modeles_vm/debian13_proxmox_nettoyer.yml
PLAYBOOK_VERIFIER_HOTE := playbooks/maintenance/verifier_hote_debian.yml
PLAYBOOK_PROXMOX_CLONER_VM := playbooks/proxmox/cloner_vm_debian.yml
DOSSIER_PLAYBOOKS_GROUPES := playbooks/groupes
.DEFAULT_GOAL := aide
.PHONY : ansible -runtime
ansible-runtime :
@mkdir -p " $( ANSIBLE_LOCAL_TEMP) "
@mkdir -p " $( ANSIBLE_SSH_CONTROL_PATH_DIR) "
.PHONY : aide
aide :
@printf '%s\n' 'Set-OPS'
@printf '%s\n' ''
@printf '%s\n' 'VM'
@printf '%s\n' ' Creer une VM complete:'
@printf '%s\n' ' make creer-vm \'
Construire l'ecosysteme de services et outiller l'inventaire
Registres (source unique):
- docs/nomenclature.yml: domaines, VMID, plan d'adressage 10.1.0.0/16 segmente.
- docs/bases-donnees.yml: bases applicatives (1 appli -> 1 base -> 1 owner -> 1 DSN).
Roles de service:
- Reseau/edge/PKI/mail: nginx, step_ca, sendmail.
- Donnees/identite: postgresql (consommateur du registre BD), redis, openldap, keycloak.
- Observabilite: prometheus, loki, grafana.
- Supervision: icinga (coeur; Icinga Web 2 differe). Forge: forgejo.
Integrations clientes:
- clients_metriques, clients_journaux, clients_pki, clients_ldap, clients_smtp.
Inventaire et outillage:
- make inventaire-ui: refonte (cartes, theme sombre, onglets, vue Chaine VM->groupes->
playbooks->roles), saisie du provisioning, auto-proposition depuis la nomenclature,
deploiement securise (verifier/deployer, jeton anti-CSRF, verrou, mot de passe vault),
robustesse reseau (connexions fermees, favicon).
- Makefile: cible verifier-deploiement; detection d'un group_vars de production chiffre.
- Scission serveurs_web -> serveurs_web_frontaux/dorsaux; migration de l'adressage vers
10.1.x; retrait des hotes de test; planification des hotes; requirements.yml.
Chaque role valide en --syntax-check et ansible-lint (profil production).
Secrets references depuis Ansible Vault (jamais en clair); roles non testes live.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:06:11 -04:00
@printf '%s\n' ' HOTE=web-frontal-01 \'
@printf '%s\n' ' VMID=95301 \'
@printf '%s\n' ' VLAN=15 \'
@printf '%s\n' ' ADRESSE_IP=10.1.15.31 \'
@printf '%s\n' ' PASSERELLE=10.1.15.1 \'
2026-06-21 15:13:45 -04:00
@printf '%s\n' ' GROUPES="serveurs_debian serveurs_durcis"'
@printf '%s\n' ' Cloner seulement, sans inventaire:'
Construire l'ecosysteme de services et outiller l'inventaire
Registres (source unique):
- docs/nomenclature.yml: domaines, VMID, plan d'adressage 10.1.0.0/16 segmente.
- docs/bases-donnees.yml: bases applicatives (1 appli -> 1 base -> 1 owner -> 1 DSN).
Roles de service:
- Reseau/edge/PKI/mail: nginx, step_ca, sendmail.
- Donnees/identite: postgresql (consommateur du registre BD), redis, openldap, keycloak.
- Observabilite: prometheus, loki, grafana.
- Supervision: icinga (coeur; Icinga Web 2 differe). Forge: forgejo.
Integrations clientes:
- clients_metriques, clients_journaux, clients_pki, clients_ldap, clients_smtp.
Inventaire et outillage:
- make inventaire-ui: refonte (cartes, theme sombre, onglets, vue Chaine VM->groupes->
playbooks->roles), saisie du provisioning, auto-proposition depuis la nomenclature,
deploiement securise (verifier/deployer, jeton anti-CSRF, verrou, mot de passe vault),
robustesse reseau (connexions fermees, favicon).
- Makefile: cible verifier-deploiement; detection d'un group_vars de production chiffre.
- Scission serveurs_web -> serveurs_web_frontaux/dorsaux; migration de l'adressage vers
10.1.x; retrait des hotes de test; planification des hotes; requirements.yml.
Chaque role valide en --syntax-check et ansible-lint (profil production).
Secrets references depuis Ansible Vault (jamais en clair); roles non testes live.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:06:11 -04:00
@printf '%s\n' ' make cloner-vm HOTE=web-frontal-01 VMID=95301 VLAN=15 ADRESSE_IP=10.1.15.31 PASSERELLE=10.1.15.1'
2026-06-21 15:13:45 -04:00
@printf '%s\n' ' Configurer Proxmox et le Vault API:'
@printf '%s\n' ' make config'
@printf '%s\n' ''
@printf '%s\n' 'Hotes'
2026-06-21 20:47:44 -04:00
@printf '%s\n' ' Planifier un hote sans le deployer:'
@printf '%s\n' ' make hote-planifier HOTE=obs-01 VMID=94101 GROUPES="serveurs_debian serveurs_durcis serveurs_prometheus serveurs_loki"'
Construire l'ecosysteme de services et outiller l'inventaire
Registres (source unique):
- docs/nomenclature.yml: domaines, VMID, plan d'adressage 10.1.0.0/16 segmente.
- docs/bases-donnees.yml: bases applicatives (1 appli -> 1 base -> 1 owner -> 1 DSN).
Roles de service:
- Reseau/edge/PKI/mail: nginx, step_ca, sendmail.
- Donnees/identite: postgresql (consommateur du registre BD), redis, openldap, keycloak.
- Observabilite: prometheus, loki, grafana.
- Supervision: icinga (coeur; Icinga Web 2 differe). Forge: forgejo.
Integrations clientes:
- clients_metriques, clients_journaux, clients_pki, clients_ldap, clients_smtp.
Inventaire et outillage:
- make inventaire-ui: refonte (cartes, theme sombre, onglets, vue Chaine VM->groupes->
playbooks->roles), saisie du provisioning, auto-proposition depuis la nomenclature,
deploiement securise (verifier/deployer, jeton anti-CSRF, verrou, mot de passe vault),
robustesse reseau (connexions fermees, favicon).
- Makefile: cible verifier-deploiement; detection d'un group_vars de production chiffre.
- Scission serveurs_web -> serveurs_web_frontaux/dorsaux; migration de l'adressage vers
10.1.x; retrait des hotes de test; planification des hotes; requirements.yml.
Chaque role valide en --syntax-check et ansible-lint (profil production).
Secrets references depuis Ansible Vault (jamais en clair); roles non testes live.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:06:11 -04:00
@printf '%s\n' ' Verifier un deploiement a blanc (dry-run):'
@printf '%s\n' ' make verifier-deploiement HOTE=web-frontal-01'
2026-06-21 15:13:45 -04:00
@printf '%s\n' ' Remettre un hote en conformite selon ses groupes:'
Construire l'ecosysteme de services et outiller l'inventaire
Registres (source unique):
- docs/nomenclature.yml: domaines, VMID, plan d'adressage 10.1.0.0/16 segmente.
- docs/bases-donnees.yml: bases applicatives (1 appli -> 1 base -> 1 owner -> 1 DSN).
Roles de service:
- Reseau/edge/PKI/mail: nginx, step_ca, sendmail.
- Donnees/identite: postgresql (consommateur du registre BD), redis, openldap, keycloak.
- Observabilite: prometheus, loki, grafana.
- Supervision: icinga (coeur; Icinga Web 2 differe). Forge: forgejo.
Integrations clientes:
- clients_metriques, clients_journaux, clients_pki, clients_ldap, clients_smtp.
Inventaire et outillage:
- make inventaire-ui: refonte (cartes, theme sombre, onglets, vue Chaine VM->groupes->
playbooks->roles), saisie du provisioning, auto-proposition depuis la nomenclature,
deploiement securise (verifier/deployer, jeton anti-CSRF, verrou, mot de passe vault),
robustesse reseau (connexions fermees, favicon).
- Makefile: cible verifier-deploiement; detection d'un group_vars de production chiffre.
- Scission serveurs_web -> serveurs_web_frontaux/dorsaux; migration de l'adressage vers
10.1.x; retrait des hotes de test; planification des hotes; requirements.yml.
Chaque role valide en --syntax-check et ansible-lint (profil production).
Secrets references depuis Ansible Vault (jamais en clair); roles non testes live.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:06:11 -04:00
@printf '%s\n' ' make deployer HOTE=web-frontal-01'
2026-06-21 15:13:45 -04:00
@printf '%s\n' ' Afficher un hote:'
Construire l'ecosysteme de services et outiller l'inventaire
Registres (source unique):
- docs/nomenclature.yml: domaines, VMID, plan d'adressage 10.1.0.0/16 segmente.
- docs/bases-donnees.yml: bases applicatives (1 appli -> 1 base -> 1 owner -> 1 DSN).
Roles de service:
- Reseau/edge/PKI/mail: nginx, step_ca, sendmail.
- Donnees/identite: postgresql (consommateur du registre BD), redis, openldap, keycloak.
- Observabilite: prometheus, loki, grafana.
- Supervision: icinga (coeur; Icinga Web 2 differe). Forge: forgejo.
Integrations clientes:
- clients_metriques, clients_journaux, clients_pki, clients_ldap, clients_smtp.
Inventaire et outillage:
- make inventaire-ui: refonte (cartes, theme sombre, onglets, vue Chaine VM->groupes->
playbooks->roles), saisie du provisioning, auto-proposition depuis la nomenclature,
deploiement securise (verifier/deployer, jeton anti-CSRF, verrou, mot de passe vault),
robustesse reseau (connexions fermees, favicon).
- Makefile: cible verifier-deploiement; detection d'un group_vars de production chiffre.
- Scission serveurs_web -> serveurs_web_frontaux/dorsaux; migration de l'adressage vers
10.1.x; retrait des hotes de test; planification des hotes; requirements.yml.
Chaque role valide en --syntax-check et ansible-lint (profil production).
Secrets references depuis Ansible Vault (jamais en clair); roles non testes live.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:06:11 -04:00
@printf '%s\n' ' make hote-afficher HOTE=web-frontal-01'
2026-06-21 15:13:45 -04:00
@printf '%s\n' ' Ajouter un hote existant:'
Construire l'ecosysteme de services et outiller l'inventaire
Registres (source unique):
- docs/nomenclature.yml: domaines, VMID, plan d'adressage 10.1.0.0/16 segmente.
- docs/bases-donnees.yml: bases applicatives (1 appli -> 1 base -> 1 owner -> 1 DSN).
Roles de service:
- Reseau/edge/PKI/mail: nginx, step_ca, sendmail.
- Donnees/identite: postgresql (consommateur du registre BD), redis, openldap, keycloak.
- Observabilite: prometheus, loki, grafana.
- Supervision: icinga (coeur; Icinga Web 2 differe). Forge: forgejo.
Integrations clientes:
- clients_metriques, clients_journaux, clients_pki, clients_ldap, clients_smtp.
Inventaire et outillage:
- make inventaire-ui: refonte (cartes, theme sombre, onglets, vue Chaine VM->groupes->
playbooks->roles), saisie du provisioning, auto-proposition depuis la nomenclature,
deploiement securise (verifier/deployer, jeton anti-CSRF, verrou, mot de passe vault),
robustesse reseau (connexions fermees, favicon).
- Makefile: cible verifier-deploiement; detection d'un group_vars de production chiffre.
- Scission serveurs_web -> serveurs_web_frontaux/dorsaux; migration de l'adressage vers
10.1.x; retrait des hotes de test; planification des hotes; requirements.yml.
Chaque role valide en --syntax-check et ansible-lint (profil production).
Secrets references depuis Ansible Vault (jamais en clair); roles non testes live.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:06:11 -04:00
@printf '%s\n' ' make hote-ajouter HOTE=web-frontal-01 VMID=95301 ADRESSE_IP=10.1.15.31 GROUPES="serveurs_debian serveurs_durcis"'
2026-06-21 15:13:45 -04:00
@printf '%s\n' ' Modifier ses groupes:'
Construire l'ecosysteme de services et outiller l'inventaire
Registres (source unique):
- docs/nomenclature.yml: domaines, VMID, plan d'adressage 10.1.0.0/16 segmente.
- docs/bases-donnees.yml: bases applicatives (1 appli -> 1 base -> 1 owner -> 1 DSN).
Roles de service:
- Reseau/edge/PKI/mail: nginx, step_ca, sendmail.
- Donnees/identite: postgresql (consommateur du registre BD), redis, openldap, keycloak.
- Observabilite: prometheus, loki, grafana.
- Supervision: icinga (coeur; Icinga Web 2 differe). Forge: forgejo.
Integrations clientes:
- clients_metriques, clients_journaux, clients_pki, clients_ldap, clients_smtp.
Inventaire et outillage:
- make inventaire-ui: refonte (cartes, theme sombre, onglets, vue Chaine VM->groupes->
playbooks->roles), saisie du provisioning, auto-proposition depuis la nomenclature,
deploiement securise (verifier/deployer, jeton anti-CSRF, verrou, mot de passe vault),
robustesse reseau (connexions fermees, favicon).
- Makefile: cible verifier-deploiement; detection d'un group_vars de production chiffre.
- Scission serveurs_web -> serveurs_web_frontaux/dorsaux; migration de l'adressage vers
10.1.x; retrait des hotes de test; planification des hotes; requirements.yml.
Chaque role valide en --syntax-check et ansible-lint (profil production).
Secrets references depuis Ansible Vault (jamais en clair); roles non testes live.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:06:11 -04:00
@printf '%s\n' ' make hote-groupes HOTE=web-frontal-01 GROUPES="serveurs_debian serveurs_durcis"'
2026-06-21 15:13:45 -04:00
@printf '%s\n' ' Diagnostiquer:'
Construire l'ecosysteme de services et outiller l'inventaire
Registres (source unique):
- docs/nomenclature.yml: domaines, VMID, plan d'adressage 10.1.0.0/16 segmente.
- docs/bases-donnees.yml: bases applicatives (1 appli -> 1 base -> 1 owner -> 1 DSN).
Roles de service:
- Reseau/edge/PKI/mail: nginx, step_ca, sendmail.
- Donnees/identite: postgresql (consommateur du registre BD), redis, openldap, keycloak.
- Observabilite: prometheus, loki, grafana.
- Supervision: icinga (coeur; Icinga Web 2 differe). Forge: forgejo.
Integrations clientes:
- clients_metriques, clients_journaux, clients_pki, clients_ldap, clients_smtp.
Inventaire et outillage:
- make inventaire-ui: refonte (cartes, theme sombre, onglets, vue Chaine VM->groupes->
playbooks->roles), saisie du provisioning, auto-proposition depuis la nomenclature,
deploiement securise (verifier/deployer, jeton anti-CSRF, verrou, mot de passe vault),
robustesse reseau (connexions fermees, favicon).
- Makefile: cible verifier-deploiement; detection d'un group_vars de production chiffre.
- Scission serveurs_web -> serveurs_web_frontaux/dorsaux; migration de l'adressage vers
10.1.x; retrait des hotes de test; planification des hotes; requirements.yml.
Chaque role valide en --syntax-check et ansible-lint (profil production).
Secrets references depuis Ansible Vault (jamais en clair); roles non testes live.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:06:11 -04:00
@printf '%s\n' ' make verifier-hote LIMITE=web-frontal-01'
2026-06-21 15:13:45 -04:00
@printf '%s\n' ''
@printf '%s\n' 'Groupes'
@printf '%s\n' ' Appliquer un groupe complet:'
@printf '%s\n' ' make deployer-groupe GROUPE=serveurs_debian'
@printf '%s\n' ' Convention:'
@printf '%s\n' ' groupe serveurs_debian -> playbooks/groupes/serveurs_debian.yml'
@printf '%s\n' ''
@printf '%s\n' 'Inventaires'
@printf '%s\n' ' Graphe de production:'
@printf '%s\n' ' make inventaire'
@printf '%s\n' ' Graphe explicite:'
@printf '%s\n' ' make inventaire-graphe FICHIER_INVENTAIRE=inventories/production/hosts.yml'
@printf '%s\n' ' Verifier les inventaires:'
@printf '%s\n' ' make inventaire-verifier'
@printf '%s\n' ' Lister les donnees brutes:'
@printf '%s\n' ' make inventaire-lister'
2026-06-21 20:35:03 -04:00
@printf '%s\n' ' Interface locale de gestion:'
@printf '%s\n' ' make inventaire-ui'
2026-06-21 15:13:45 -04:00
@printf '%s\n' ''
@printf '%s\n' 'Modele Debian 13 Proxmox'
@printf '%s\n' ' Construire et verifier:'
@printf '%s\n' ' make preparer-modele'
@printf '%s\n' ' make verifier-modele'
@printf '%s\n' ' Nettoyage final protege:'
@printf '%s\n' ' make nettoyer-modele CONFIRMER=true'
@printf '%s\n' ''
@printf '%s\n' 'Validation'
@printf '%s\n' ' make syntaxe'
@printf '%s\n' ' make lint'
@printf '%s\n' ' make verifier'
@printf '%s\n' ''
@printf '%s\n' 'Variables frequentes'
Construire l'ecosysteme de services et outiller l'inventaire
Registres (source unique):
- docs/nomenclature.yml: domaines, VMID, plan d'adressage 10.1.0.0/16 segmente.
- docs/bases-donnees.yml: bases applicatives (1 appli -> 1 base -> 1 owner -> 1 DSN).
Roles de service:
- Reseau/edge/PKI/mail: nginx, step_ca, sendmail.
- Donnees/identite: postgresql (consommateur du registre BD), redis, openldap, keycloak.
- Observabilite: prometheus, loki, grafana.
- Supervision: icinga (coeur; Icinga Web 2 differe). Forge: forgejo.
Integrations clientes:
- clients_metriques, clients_journaux, clients_pki, clients_ldap, clients_smtp.
Inventaire et outillage:
- make inventaire-ui: refonte (cartes, theme sombre, onglets, vue Chaine VM->groupes->
playbooks->roles), saisie du provisioning, auto-proposition depuis la nomenclature,
deploiement securise (verifier/deployer, jeton anti-CSRF, verrou, mot de passe vault),
robustesse reseau (connexions fermees, favicon).
- Makefile: cible verifier-deploiement; detection d'un group_vars de production chiffre.
- Scission serveurs_web -> serveurs_web_frontaux/dorsaux; migration de l'adressage vers
10.1.x; retrait des hotes de test; planification des hotes; requirements.yml.
Chaque role valide en --syntax-check et ansible-lint (profil production).
Secrets references depuis Ansible Vault (jamais en clair); roles non testes live.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:06:11 -04:00
@printf '%s\n' ' HOTE=web-frontal-01 GROUPE=serveurs_debian GROUPES="serveurs_debian serveurs_durcis"'
@printf '%s\n' ' VMID=95301 VLAN=15 ADRESSE_IP=10.1.15.31 PASSERELLE=10.1.15.1'
2026-06-21 21:31:03 -04:00
@printf '%s\n' ' FICHIER_INVENTAIRE=inventories/production/hosts.yml FICHIER_DEPENDANCES=docs/dependances-groupes.yml CONFIRMER=true'
2026-06-21 15:13:45 -04:00
.PHONY : lint
lint : ansible -runtime
ansible-lint
.PHONY : syntaxe syntaxe -modele syntaxe -nettoyage syntaxe -verification -modele syntaxe -verification -hote syntaxe -groupes syntaxe -proxmox
syntaxe : syntaxe -modele syntaxe -verification -modele syntaxe -nettoyage syntaxe -verification -hote syntaxe -groupes syntaxe -proxmox
syntaxe-modele : ansible -runtime
ansible-playbook -i $( INVENTAIRE_LAB) $( PLAYBOOK_PREPARER_MODELE) --syntax-check
syntaxe-verification-modele : ansible -runtime
ansible-playbook -i $( INVENTAIRE_LAB) $( PLAYBOOK_VERIFIER_MODELE) --syntax-check
syntaxe-nettoyage : ansible -runtime
ansible-playbook -i $( INVENTAIRE_LAB) $( PLAYBOOK_NETTOYER_MODELE) --syntax-check
syntaxe-verification-hote : ansible -runtime
ansible-playbook -i $( INVENTAIRE_PRODUCTION) $( PLAYBOOK_VERIFIER_HOTE) --syntax-check
syntaxe-groupes : ansible -runtime
@for playbook in $( DOSSIER_PLAYBOOKS_GROUPES) /*.yml; do \
ansible-playbook -i $( INVENTAIRE_PRODUCTION) " $$ playbook " --syntax-check; \
done
syntaxe-proxmox : ansible -runtime
ansible-playbook -i localhost, $( PLAYBOOK_PROXMOX_CLONER_VM) --syntax-check
.PHONY : verifier
2026-06-21 20:35:03 -04:00
verifier : lint inventaire -verifier syntaxe
2026-06-21 15:13:45 -04:00
2026-06-21 20:47:44 -04:00
.PHONY : inventaire hote -planifier hote -ajouter hote -groupes hote -afficher appliquer deployer deployer -groupe cloner -vm creer -vm config inventaire -ui inventaire -verifier inventaire -lister inventaire -graphe inventaire -hote inventaire -lab inventaire -production
2026-06-21 15:13:45 -04:00
inventaire : inventaire -production
config :
python3 scripts/config_proxmox.py
2026-06-21 20:35:03 -04:00
inventaire-ui :
python3 scripts/inventory_gui.py --inventaire $( FICHIER_INVENTAIRE)
2026-06-21 15:13:45 -04:00
hote-ajouter : ansible -runtime
@if [ [ -z " $( HOTE) " || -z " $( ADRESSE_IP) " ] ] ; then \
printf '%s\n' 'Refus: relancer avec HOTE=nom_hote ADRESSE_IP=adresse_ip.' ; \
exit 2; \
fi
2026-06-21 21:31:03 -04:00
python3 scripts/inventory_host.py --inventaire $( FICHIER_INVENTAIRE) --dependances $( FICHIER_DEPENDANCES) ajouter --hote $( HOTE) --adresse-ip $( ADRESSE_IP) --utilisateur-ansible $( UTILISATEUR_ANSIBLE) --vmid " $( VMID) " --groupes " $( GROUPES) " --dossier-playbooks $( DOSSIER_PLAYBOOKS_GROUPES)
2026-06-21 20:47:44 -04:00
$( MAKE) inventaire-verifier
$( MAKE) hote-afficher HOTE = " $( HOTE) " FICHIER_INVENTAIRE = " $( FICHIER_INVENTAIRE) "
hote-planifier : ansible -runtime
@if [ [ -z " $( HOTE) " ] ] ; then \
printf '%s\n' 'Refus: relancer avec HOTE=nom_hote GROUPES="groupe1 groupe2".' ; \
exit 2; \
fi
2026-06-21 21:31:03 -04:00
python3 scripts/inventory_host.py --inventaire $( FICHIER_INVENTAIRE) --dependances $( FICHIER_DEPENDANCES) ajouter --hote $( HOTE) --vmid " $( VMID) " --groupes " $( GROUPES) " --dossier-playbooks $( DOSSIER_PLAYBOOKS_GROUPES)
2026-06-21 15:13:45 -04:00
$( MAKE) inventaire-verifier
$( MAKE) hote-afficher HOTE = " $( HOTE) " FICHIER_INVENTAIRE = " $( FICHIER_INVENTAIRE) "
hote-groupes : ansible -runtime
@if [ [ -z " $( HOTE) " ] ] ; then \
printf '%s\n' 'Refus: relancer avec HOTE=nom_hote GROUPES="groupe1 groupe2".' ; \
exit 2; \
fi
2026-06-21 21:31:03 -04:00
python3 scripts/inventory_host.py --inventaire $( FICHIER_INVENTAIRE) --dependances $( FICHIER_DEPENDANCES) definir-groupes --hote $( HOTE) --groupes " $( GROUPES) " --dossier-playbooks $( DOSSIER_PLAYBOOKS_GROUPES)
2026-06-21 15:13:45 -04:00
$( MAKE) inventaire-verifier
$( MAKE) hote-afficher HOTE = " $( HOTE) " FICHIER_INVENTAIRE = " $( FICHIER_INVENTAIRE) "
hote-afficher : ansible -runtime
@if [ [ -z " $( HOTE) " ] ] ; then \
printf '%s\n' 'Refus: relancer avec HOTE=nom_hote.' ; \
exit 2; \
fi
python3 scripts/inventory_host.py --inventaire $( FICHIER_INVENTAIRE) afficher --hote $( HOTE)
appliquer : ansible -runtime
@if [ [ -z " $( GROUPE) " ] ] ; then \
printf '%s\n' 'Refus: relancer avec GROUPE=nom_groupe.' ; \
exit 2; \
fi
@if [ [ ! -f " $( DOSSIER_PLAYBOOKS_GROUPES) / $( GROUPE) .yml " ] ] ; then \
printf '%s\n' 'Refus: aucun playbook pour ce groupe: $(DOSSIER_PLAYBOOKS_GROUPES)/$(GROUPE).yml' ; \
exit 2; \
fi
2026-06-21 21:31:03 -04:00
python3 scripts/inventory_host.py --inventaire $( INVENTAIRE_PRODUCTION) --dependances $( FICHIER_DEPENDANCES) verifier-dependances-groupe --groupe $( GROUPE)
2026-06-21 20:35:03 -04:00
ansible-playbook -i $( INVENTAIRE_PRODUCTION) " $( DOSSIER_PLAYBOOKS_GROUPES) / $( GROUPE) .yml " --limit '$(GROUPE):&$(GROUPE_HOTES_ACTIFS)'
2026-06-21 15:13:45 -04:00
deployer :
Construire l'ecosysteme de services et outiller l'inventaire
Registres (source unique):
- docs/nomenclature.yml: domaines, VMID, plan d'adressage 10.1.0.0/16 segmente.
- docs/bases-donnees.yml: bases applicatives (1 appli -> 1 base -> 1 owner -> 1 DSN).
Roles de service:
- Reseau/edge/PKI/mail: nginx, step_ca, sendmail.
- Donnees/identite: postgresql (consommateur du registre BD), redis, openldap, keycloak.
- Observabilite: prometheus, loki, grafana.
- Supervision: icinga (coeur; Icinga Web 2 differe). Forge: forgejo.
Integrations clientes:
- clients_metriques, clients_journaux, clients_pki, clients_ldap, clients_smtp.
Inventaire et outillage:
- make inventaire-ui: refonte (cartes, theme sombre, onglets, vue Chaine VM->groupes->
playbooks->roles), saisie du provisioning, auto-proposition depuis la nomenclature,
deploiement securise (verifier/deployer, jeton anti-CSRF, verrou, mot de passe vault),
robustesse reseau (connexions fermees, favicon).
- Makefile: cible verifier-deploiement; detection d'un group_vars de production chiffre.
- Scission serveurs_web -> serveurs_web_frontaux/dorsaux; migration de l'adressage vers
10.1.x; retrait des hotes de test; planification des hotes; requirements.yml.
Chaque role valide en --syntax-check et ansible-lint (profil production).
Secrets references depuis Ansible Vault (jamais en clair); roles non testes live.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:06:11 -04:00
@set -e; \
if [ [ -z " $( HOTE) " ] ] ; then \
2026-06-21 15:13:45 -04:00
printf '%s\n' 'Refus: relancer avec HOTE=nom_hote.' ; \
exit 2; \
Construire l'ecosysteme de services et outiller l'inventaire
Registres (source unique):
- docs/nomenclature.yml: domaines, VMID, plan d'adressage 10.1.0.0/16 segmente.
- docs/bases-donnees.yml: bases applicatives (1 appli -> 1 base -> 1 owner -> 1 DSN).
Roles de service:
- Reseau/edge/PKI/mail: nginx, step_ca, sendmail.
- Donnees/identite: postgresql (consommateur du registre BD), redis, openldap, keycloak.
- Observabilite: prometheus, loki, grafana.
- Supervision: icinga (coeur; Icinga Web 2 differe). Forge: forgejo.
Integrations clientes:
- clients_metriques, clients_journaux, clients_pki, clients_ldap, clients_smtp.
Inventaire et outillage:
- make inventaire-ui: refonte (cartes, theme sombre, onglets, vue Chaine VM->groupes->
playbooks->roles), saisie du provisioning, auto-proposition depuis la nomenclature,
deploiement securise (verifier/deployer, jeton anti-CSRF, verrou, mot de passe vault),
robustesse reseau (connexions fermees, favicon).
- Makefile: cible verifier-deploiement; detection d'un group_vars de production chiffre.
- Scission serveurs_web -> serveurs_web_frontaux/dorsaux; migration de l'adressage vers
10.1.x; retrait des hotes de test; planification des hotes; requirements.yml.
Chaque role valide en --syntax-check et ansible-lint (profil production).
Secrets references depuis Ansible Vault (jamais en clair); roles non testes live.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:06:11 -04:00
fi ; \
python3 scripts/inventory_host.py --inventaire $( FICHIER_INVENTAIRE) verifier-actif --hote $( HOTE) ; \
python3 scripts/inventory_host.py --inventaire $( FICHIER_INVENTAIRE) --dependances $( FICHIER_DEPENDANCES) verifier-dependances-hote --hote $( HOTE) ; \
playbooks = " $$ (python3 scripts/inventory_host.py --inventaire $( FICHIER_INVENTAIRE) playbooks --hote $( HOTE) --dossier-playbooks $( DOSSIER_PLAYBOOKS_GROUPES) ) " ; \
2026-06-21 15:13:45 -04:00
if [ [ -z " $$ playbooks " ] ] ; then \
printf '%s\n' 'Refus: aucun playbook applicable pour HOTE=$(HOTE).' ; \
exit 2; \
fi ; \
Construire l'ecosysteme de services et outiller l'inventaire
Registres (source unique):
- docs/nomenclature.yml: domaines, VMID, plan d'adressage 10.1.0.0/16 segmente.
- docs/bases-donnees.yml: bases applicatives (1 appli -> 1 base -> 1 owner -> 1 DSN).
Roles de service:
- Reseau/edge/PKI/mail: nginx, step_ca, sendmail.
- Donnees/identite: postgresql (consommateur du registre BD), redis, openldap, keycloak.
- Observabilite: prometheus, loki, grafana.
- Supervision: icinga (coeur; Icinga Web 2 differe). Forge: forgejo.
Integrations clientes:
- clients_metriques, clients_journaux, clients_pki, clients_ldap, clients_smtp.
Inventaire et outillage:
- make inventaire-ui: refonte (cartes, theme sombre, onglets, vue Chaine VM->groupes->
playbooks->roles), saisie du provisioning, auto-proposition depuis la nomenclature,
deploiement securise (verifier/deployer, jeton anti-CSRF, verrou, mot de passe vault),
robustesse reseau (connexions fermees, favicon).
- Makefile: cible verifier-deploiement; detection d'un group_vars de production chiffre.
- Scission serveurs_web -> serveurs_web_frontaux/dorsaux; migration de l'adressage vers
10.1.x; retrait des hotes de test; planification des hotes; requirements.yml.
Chaque role valide en --syntax-check et ansible-lint (profil production).
Secrets references depuis Ansible Vault (jamais en clair); roles non testes live.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:06:11 -04:00
vault_chiffre = " $$ (grep -rlsIF ' $$ ANSIBLE_VAULT' inventories/production/group_vars 2>/dev/null | head -1 || true) " ; \
if [ [ -n " $$ vault_chiffre " && -z " $$ {ANSIBLE_VAULT_PASSWORD_FILE:-} " ] ] ; then \
if [ [ -t 0 ] ] ; then \
read -r -s -p 'Mot de passe du vault Ansible: ' mdp; echo; \
vf = " $$ (mktemp) " ; printf '%s' " $$ mdp " > " $$ vf " ; chmod 600 " $$ vf " ; \
export ANSIBLE_VAULT_PASSWORD_FILE = " $$ vf " ; \
trap 'rm -f "$$vf"' EXIT; \
else \
printf '%s\n' 'Refus: vault chiffre detecte mais aucun mot de passe (entree non interactive). Fournir ANSIBLE_VAULT_PASSWORD_FILE ou le champ vault de la GUI.' ; \
exit 2; \
fi ; \
fi ; \
$( MAKE) _verifier-acces-hote LIMITE = " $( HOTE) " ; \
$( MAKE) _verifier-privileges-hote LIMITE = " $( HOTE) " ; \
2026-06-21 15:13:45 -04:00
for playbook in $$ playbooks; do \
ansible-playbook -i $( INVENTAIRE_PRODUCTION) " $$ playbook " --limit " $( HOTE) " ; \
Construire l'ecosysteme de services et outiller l'inventaire
Registres (source unique):
- docs/nomenclature.yml: domaines, VMID, plan d'adressage 10.1.0.0/16 segmente.
- docs/bases-donnees.yml: bases applicatives (1 appli -> 1 base -> 1 owner -> 1 DSN).
Roles de service:
- Reseau/edge/PKI/mail: nginx, step_ca, sendmail.
- Donnees/identite: postgresql (consommateur du registre BD), redis, openldap, keycloak.
- Observabilite: prometheus, loki, grafana.
- Supervision: icinga (coeur; Icinga Web 2 differe). Forge: forgejo.
Integrations clientes:
- clients_metriques, clients_journaux, clients_pki, clients_ldap, clients_smtp.
Inventaire et outillage:
- make inventaire-ui: refonte (cartes, theme sombre, onglets, vue Chaine VM->groupes->
playbooks->roles), saisie du provisioning, auto-proposition depuis la nomenclature,
deploiement securise (verifier/deployer, jeton anti-CSRF, verrou, mot de passe vault),
robustesse reseau (connexions fermees, favicon).
- Makefile: cible verifier-deploiement; detection d'un group_vars de production chiffre.
- Scission serveurs_web -> serveurs_web_frontaux/dorsaux; migration de l'adressage vers
10.1.x; retrait des hotes de test; planification des hotes; requirements.yml.
Chaque role valide en --syntax-check et ansible-lint (profil production).
Secrets references depuis Ansible Vault (jamais en clair); roles non testes live.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:06:11 -04:00
done ; \
2026-06-21 15:13:45 -04:00
$( MAKE) verifier-hote LIMITE = " $( HOTE) "
deployer-groupe :
@if [ [ -z " $( GROUPE) " ] ] ; then \
printf '%s\n' 'Refus: relancer avec GROUPE=nom_groupe.' ; \
exit 2; \
fi
$( MAKE) appliquer GROUPE = " $( GROUPE) "
Construire l'ecosysteme de services et outiller l'inventaire
Registres (source unique):
- docs/nomenclature.yml: domaines, VMID, plan d'adressage 10.1.0.0/16 segmente.
- docs/bases-donnees.yml: bases applicatives (1 appli -> 1 base -> 1 owner -> 1 DSN).
Roles de service:
- Reseau/edge/PKI/mail: nginx, step_ca, sendmail.
- Donnees/identite: postgresql (consommateur du registre BD), redis, openldap, keycloak.
- Observabilite: prometheus, loki, grafana.
- Supervision: icinga (coeur; Icinga Web 2 differe). Forge: forgejo.
Integrations clientes:
- clients_metriques, clients_journaux, clients_pki, clients_ldap, clients_smtp.
Inventaire et outillage:
- make inventaire-ui: refonte (cartes, theme sombre, onglets, vue Chaine VM->groupes->
playbooks->roles), saisie du provisioning, auto-proposition depuis la nomenclature,
deploiement securise (verifier/deployer, jeton anti-CSRF, verrou, mot de passe vault),
robustesse reseau (connexions fermees, favicon).
- Makefile: cible verifier-deploiement; detection d'un group_vars de production chiffre.
- Scission serveurs_web -> serveurs_web_frontaux/dorsaux; migration de l'adressage vers
10.1.x; retrait des hotes de test; planification des hotes; requirements.yml.
Chaque role valide en --syntax-check et ansible-lint (profil production).
Secrets references depuis Ansible Vault (jamais en clair); roles non testes live.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:06:11 -04:00
.PHONY : verifier -deploiement
verifier-deploiement : ansible -runtime
@set -e; \
if [ [ -z " $( HOTE) " ] ] ; then \
printf '%s\n' 'Refus: relancer avec HOTE=nom_hote.' ; \
exit 2; \
fi ; \
python3 scripts/inventory_host.py --inventaire $( FICHIER_INVENTAIRE) verifier-actif --hote $( HOTE) ; \
python3 scripts/inventory_host.py --inventaire $( FICHIER_INVENTAIRE) --dependances $( FICHIER_DEPENDANCES) verifier-dependances-hote --hote $( HOTE) ; \
playbooks = " $$ (python3 scripts/inventory_host.py --inventaire $( FICHIER_INVENTAIRE) playbooks --hote $( HOTE) --dossier-playbooks $( DOSSIER_PLAYBOOKS_GROUPES) ) " ; \
if [ [ -z " $$ playbooks " ] ] ; then \
printf '%s\n' 'Refus: aucun playbook applicable pour HOTE=$(HOTE).' ; \
exit 2; \
fi ; \
vault_chiffre = " $$ (grep -rlsIF ' $$ ANSIBLE_VAULT' inventories/production/group_vars 2>/dev/null | head -1 || true) " ; \
if [ [ -n " $$ vault_chiffre " && -z " $$ {ANSIBLE_VAULT_PASSWORD_FILE:-} " ] ] ; then \
if [ [ -t 0 ] ] ; then \
read -r -s -p 'Mot de passe du vault Ansible: ' mdp; echo; \
vf = " $$ (mktemp) " ; printf '%s' " $$ mdp " > " $$ vf " ; chmod 600 " $$ vf " ; \
export ANSIBLE_VAULT_PASSWORD_FILE = " $$ vf " ; \
trap 'rm -f "$$vf"' EXIT; \
else \
printf '%s\n' 'Refus: vault chiffre detecte mais aucun mot de passe (entree non interactive). Fournir ANSIBLE_VAULT_PASSWORD_FILE ou le champ vault de la GUI.' ; \
exit 2; \
fi ; \
fi ; \
for playbook in $$ playbooks; do \
ansible-playbook -i $( INVENTAIRE_PRODUCTION) " $$ playbook " --limit " $( HOTE) " --check --diff; \
done
2026-06-21 15:13:45 -04:00
cloner-vm : ansible -runtime
@if [ [ -z " $( HOTE) " || -z " $( VMID) " ] ] ; then \
printf '%s\n' 'Refus: relancer avec HOTE=nom VMID=id_clone.' ; \
exit 2; \
fi
@if [ [ -z " $( VLAN) " ] ] ; then \
printf '%s\n' 'Refus: relancer avec VLAN=id_vlan.' ; \
exit 2; \
fi
@if ! [ [ " $( VLAN) " = ~ ^[ 0-9] +$$ ] ] || ( ( 10#$( VLAN) < 1 || 10#$( VLAN) > 4094 ) ) ; then \
printf '%s\n' 'Refus: VLAN doit etre un nombre entre 1 et 4094.' ; \
exit 2; \
fi
@if [ [ -n " $( CLE_SSH_PUBLIQUE) " && ! -f " $( CLE_SSH_PUBLIQUE) " ] ] ; then \
printf '%s\n' 'Refus: cle publique SSH introuvable: $(CLE_SSH_PUBLIQUE)' ; \
exit 2; \
fi
@if [ [ " $( DHCP) " != "true" && ( -z " $( ADRESSE_IP) " || -z " $( CIDR) " || -z " $( PASSERELLE) " ) ] ] ; then \
printf '%s\n' 'Refus: fournir ADRESSE_IP, CIDR et PASSERELLE, ou utiliser DHCP=true.' ; \
exit 2; \
fi
@ipconfig= 'ip=dhcp' ; \
if [ [ " $( DHCP) " != "true" ] ] ; then \
ipconfig = 'ip=$(ADRESSE_IP)/$(CIDR),gw=$(PASSERELLE)' ; \
fi ; \
extra_vars = ( \
-e proxmox_clone_nom = " $( HOTE) " \
-e proxmox_clone_vmid = " $( VMID) " \
-e proxmox_clone_ipconfig0 = " $$ ipconfig " \
) ; \
[ [ -n " $( VMID_MODELE) " ] ] && extra_vars += ( -e proxmox_clone_vmid_modele = " $( VMID_MODELE) " ) ; \
[ [ -n " $( NOEUD_PROXMOX) " ] ] && extra_vars += ( -e proxmox_clone_noeud = " $( NOEUD_PROXMOX) " ) ; \
[ [ -n " $( STOCKAGE_PROXMOX) " ] ] && extra_vars += ( -e proxmox_clone_stockage = " $( STOCKAGE_PROXMOX) " ) ; \
[ [ -n " $( FORMAT_DISQUE) " ] ] && extra_vars += ( -e proxmox_clone_format = " $( FORMAT_DISQUE) " ) ; \
[ [ -n " $( CLONE_COMPLET) " ] ] && extra_vars += ( -e proxmox_clone_complet = " $( CLONE_COMPLET) " ) ; \
[ [ -n " $( TAILLE_DISQUE) " ] ] && extra_vars += ( -e proxmox_clone_taille_disque = " $( TAILLE_DISQUE) " ) ; \
[ [ -n " $( DISQUE_PROXMOX) " ] ] && extra_vars += ( -e proxmox_clone_disque = " $( DISQUE_PROXMOX) " ) ; \
[ [ -n " $( DNS) " ] ] && extra_vars += ( -e proxmox_clone_dns = " $( DNS) " ) ; \
[ [ -n " $( CIUSER) " ] ] && extra_vars += ( -e proxmox_clone_ciuser = " $( CIUSER) " ) ; \
[ [ -n " $( CLE_SSH_PUBLIQUE) " ] ] && extra_vars += ( -e proxmox_clone_cle_publique_fichier = " $( CLE_SSH_PUBLIQUE) " ) ; \
[ [ -n " $( PONT_PROXMOX) " ] ] && extra_vars += ( -e proxmox_clone_pont = " $( PONT_PROXMOX) " ) ; \
extra_vars += ( -e proxmox_clone_vlan = " $( VLAN) " ) ; \
[ [ -n " $( DEMARRER) " ] ] && extra_vars += ( -e proxmox_clone_demarrer = " $( DEMARRER) " ) ; \
vault_args = ( ) ; \
vault_file = "inventories/lab/group_vars/proxmox.vault.yml" ; \
if [ [ -f " $$ vault_file " ] ] ; then \
read -r premiere_ligne < " $$ vault_file " || true; \
case " $$ premiere_ligne " in \
'$$ANSIBLE_VAULT' *) \
if [ [ -z " $$ {ANSIBLE_VAULT_PASSWORD_FILE:-} " ] ] ; then \
vault_args += ( --ask-vault-pass ) ; \
fi ; \
; ; \
esac ; \
fi ; \
ansible-playbook -i localhost, $( PLAYBOOK_PROXMOX_CLONER_VM) " $$ {vault_args[@]} " " $$ {extra_vars[@]} "
creer-vm :
@if [ [ -z " $( ADRESSE_IP) " ] ] ; then \
printf '%s\n' 'Refus: creer-vm doit recevoir ADRESSE_IP pour inscrire l hote dans l inventaire.' ; \
exit 2; \
fi
$( MAKE) cloner-vm HOTE = " $( HOTE) " VMID_MODELE = " $( VMID_MODELE) " VMID = " $( VMID) " NOEUD_PROXMOX = " $( NOEUD_PROXMOX) " STOCKAGE_PROXMOX = " $( STOCKAGE_PROXMOX) " FORMAT_DISQUE = " $( FORMAT_DISQUE) " TAILLE_DISQUE = " $( TAILLE_DISQUE) " DISQUE_PROXMOX = " $( DISQUE_PROXMOX) " ADRESSE_IP = " $( ADRESSE_IP) " CIDR = " $( CIDR) " PASSERELLE = " $( PASSERELLE) " DNS = " $( DNS) " DHCP = " $( DHCP) " CIUSER = " $( CIUSER) " CLE_SSH_PUBLIQUE = " $( CLE_SSH_PUBLIQUE) " PONT_PROXMOX = " $( PONT_PROXMOX) " VLAN = " $( VLAN) " DEMARRER = " $( DEMARRER) " CLONE_COMPLET = " $( CLONE_COMPLET) "
2026-06-21 20:47:44 -04:00
$( MAKE) hote-ajouter HOTE = " $( HOTE) " ADRESSE_IP = " $( ADRESSE_IP) " VMID = " $( VMID) " GROUPES = " $( GROUPES) " FICHIER_INVENTAIRE = " $( FICHIER_INVENTAIRE) "
2026-06-21 15:13:45 -04:00
inventaire-verifier : ansible -runtime
ansible-inventory -i $( INVENTAIRE_LAB) --list > /dev/null
ansible-inventory -i $( INVENTAIRE_PRODUCTION) --list > /dev/null
2026-06-21 20:35:03 -04:00
python3 scripts/inventory_host.py --inventaire $( INVENTAIRE_PRODUCTION) verifier-playbooks --dossier-playbooks $( DOSSIER_PLAYBOOKS_GROUPES)
2026-06-21 21:31:03 -04:00
python3 scripts/inventory_host.py --inventaire $( INVENTAIRE_PRODUCTION) --dependances $( FICHIER_DEPENDANCES) verifier-dependances --dossier-playbooks $( DOSSIER_PLAYBOOKS_GROUPES)
Faire de l'application une entite de premiere classe (BD multi-portee)
Une VM peut porter plusieurs applications ; c'est l'application, pas l'hote,
a laquelle une base se lie via son DSN.
- docs/applications.yml : nouveau registre application -> groupe, hote.
- docs/bases-donnees.yml : champ 'portee' (application|groupe|hote, defaut
groupe). Une application A (groupe G, hote H) recoit les bases ou
(portee=application ET consommateur=A) OU (portee=groupe ET consommateur=G)
OU (portee=hote ET consommateur=H). Plusieurs DSN par application.
- inventory_rules.py : charger/valider_applications, applications_de_hote,
bases_de_application, PORTEES_BD ; valider_bases croise portee=application
avec le registre des applications.
- CLI : scripts/applications.py + bases_donnees.py --portee ; cibles make
applications / applications-verifier ; integre a inventaire-verifier.
- GUI : vue Applications (CRUD), portee + consommateur dynamique dans Bases,
vue Chaine par application (DSN resolus par hote).
- filter_plugins/registres.py : meme regle de resolution exposee a Ansible
(source unique). Playbooks web_dorsaux/web_frontaux iterent sur les
applications de l'hote (scaffold ; deploiement applicatif s'y insere).
Services en grappe (keycloak/icingadb/forgejo) restent en portee groupe.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 13:38:30 -04:00
python3 scripts/applications.py verifier
2026-06-22 19:14:12 -04:00
python3 scripts/bases_donnees.py verifier
Poser le registre des domaines publics (primaire cache)
Registre declaratif docs/domaines.yml pour la publication externe des
hostnames, symetrique de docs/bases-donnees.yml. Modele d'autorite :
primaire cache + secondaires. Le bloc « exposition » est le binding
nom public -> service interne (cible) -> edge, destine a trois
consommateurs (zone publique, vhosts nginx, ACME).
- inventory_rules.py : charger_domaines, valider_domaines,
fqdn_exposition, expositions_du_groupe, AUTORITES_DNS.
- scripts/domaines.py : CLI miroir (lister / verifier).
- Makefile : cibles domaines / domaines-verifier + validation dans
inventaire-verifier.
Premiere entree reelle : forge.alliance-boreale.ca -> serveurs_forgejo.
Secondaires, mail et DNSSEC laisses a renseigner (structurel, pas
encore operationnel ; l'interne chezlepro.internal n'est pas touche).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 20:29:29 -04:00
python3 scripts/domaines.py verifier
2026-06-22 19:14:12 -04:00
Faire de l'application une entite de premiere classe (BD multi-portee)
Une VM peut porter plusieurs applications ; c'est l'application, pas l'hote,
a laquelle une base se lie via son DSN.
- docs/applications.yml : nouveau registre application -> groupe, hote.
- docs/bases-donnees.yml : champ 'portee' (application|groupe|hote, defaut
groupe). Une application A (groupe G, hote H) recoit les bases ou
(portee=application ET consommateur=A) OU (portee=groupe ET consommateur=G)
OU (portee=hote ET consommateur=H). Plusieurs DSN par application.
- inventory_rules.py : charger/valider_applications, applications_de_hote,
bases_de_application, PORTEES_BD ; valider_bases croise portee=application
avec le registre des applications.
- CLI : scripts/applications.py + bases_donnees.py --portee ; cibles make
applications / applications-verifier ; integre a inventaire-verifier.
- GUI : vue Applications (CRUD), portee + consommateur dynamique dans Bases,
vue Chaine par application (DSN resolus par hote).
- filter_plugins/registres.py : meme regle de resolution exposee a Ansible
(source unique). Playbooks web_dorsaux/web_frontaux iterent sur les
applications de l'hote (scaffold ; deploiement applicatif s'y insere).
Services en grappe (keycloak/icingadb/forgejo) restent en portee groupe.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 13:38:30 -04:00
.PHONY : bases bases -verifier domaines domaines -verifier applications applications -verifier
2026-06-22 19:14:12 -04:00
bases :
python3 scripts/bases_donnees.py lister
bases-verifier :
python3 scripts/bases_donnees.py verifier
2026-06-21 15:13:45 -04:00
Poser le registre des domaines publics (primaire cache)
Registre declaratif docs/domaines.yml pour la publication externe des
hostnames, symetrique de docs/bases-donnees.yml. Modele d'autorite :
primaire cache + secondaires. Le bloc « exposition » est le binding
nom public -> service interne (cible) -> edge, destine a trois
consommateurs (zone publique, vhosts nginx, ACME).
- inventory_rules.py : charger_domaines, valider_domaines,
fqdn_exposition, expositions_du_groupe, AUTORITES_DNS.
- scripts/domaines.py : CLI miroir (lister / verifier).
- Makefile : cibles domaines / domaines-verifier + validation dans
inventaire-verifier.
Premiere entree reelle : forge.alliance-boreale.ca -> serveurs_forgejo.
Secondaires, mail et DNSSEC laisses a renseigner (structurel, pas
encore operationnel ; l'interne chezlepro.internal n'est pas touche).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 20:29:29 -04:00
domaines :
python3 scripts/domaines.py lister
domaines-verifier :
python3 scripts/domaines.py verifier
Faire de l'application une entite de premiere classe (BD multi-portee)
Une VM peut porter plusieurs applications ; c'est l'application, pas l'hote,
a laquelle une base se lie via son DSN.
- docs/applications.yml : nouveau registre application -> groupe, hote.
- docs/bases-donnees.yml : champ 'portee' (application|groupe|hote, defaut
groupe). Une application A (groupe G, hote H) recoit les bases ou
(portee=application ET consommateur=A) OU (portee=groupe ET consommateur=G)
OU (portee=hote ET consommateur=H). Plusieurs DSN par application.
- inventory_rules.py : charger/valider_applications, applications_de_hote,
bases_de_application, PORTEES_BD ; valider_bases croise portee=application
avec le registre des applications.
- CLI : scripts/applications.py + bases_donnees.py --portee ; cibles make
applications / applications-verifier ; integre a inventaire-verifier.
- GUI : vue Applications (CRUD), portee + consommateur dynamique dans Bases,
vue Chaine par application (DSN resolus par hote).
- filter_plugins/registres.py : meme regle de resolution exposee a Ansible
(source unique). Playbooks web_dorsaux/web_frontaux iterent sur les
applications de l'hote (scaffold ; deploiement applicatif s'y insere).
Services en grappe (keycloak/icingadb/forgejo) restent en portee groupe.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 13:38:30 -04:00
applications :
python3 scripts/applications.py lister
applications-verifier :
python3 scripts/applications.py verifier
2026-06-21 15:13:45 -04:00
inventaire-lister : ansible -runtime
ansible-inventory -i $( FICHIER_INVENTAIRE) --list
inventaire-graphe : ansible -runtime
ansible-inventory -i $( FICHIER_INVENTAIRE) --graph
inventaire-hote : ansible -runtime
@if [ [ -z " $( HOTE) " ] ] ; then \
printf '%s\n' 'Refus: relancer avec HOTE=nom_hote.' ; \
exit 2; \
fi
ansible-inventory -i $( FICHIER_INVENTAIRE) --host $( HOTE)
inventaire-lab :
$( MAKE) inventaire-graphe FICHIER_INVENTAIRE = " $( INVENTAIRE_LAB) "
inventaire-production :
$( MAKE) inventaire-graphe FICHIER_INVENTAIRE = " $( INVENTAIRE_PRODUCTION) "
.PHONY : _verifier -acces -modele _verifier -privileges -modele preparer -modele verifier -modele nettoyer -modele
_verifier-acces-modele : ansible -runtime
ansible -i $( INVENTAIRE_LAB) $( GROUPE_MODELE) -m ping -e ansible_become = false
_verifier-privileges-modele : ansible -runtime
ansible -i $( INVENTAIRE_LAB) $( GROUPE_MODELE) -b -m command -a "whoami"
preparer-modele : ansible -runtime _verifier -acces -modele _verifier -privileges -modele
ansible-playbook -i $( INVENTAIRE_LAB) $( PLAYBOOK_PREPARER_MODELE)
verifier-modele : ansible -runtime
ansible-playbook -i $( INVENTAIRE_LAB) $( PLAYBOOK_VERIFIER_MODELE)
nettoyer-modele : ansible -runtime
@if [ [ " $( CONFIRMER) " != "true" ] ] ; then \
printf '%s\n' 'Refus: relancer avec CONFIRMER=true pour le nettoyage final du modele.' ; \
exit 2; \
fi
ansible-playbook -i $( INVENTAIRE_LAB) $( PLAYBOOK_NETTOYER_MODELE) -e template_cleanup_confirm = true
.PHONY : _verifier -acces -hote _verifier -privileges -hote faits verifier -hote
_verifier-acces-hote : ansible -runtime
ansible -i $( INVENTAIRE_PRODUCTION) $( LIMITE) -m ping -e ansible_become = false
_verifier-privileges-hote : ansible -runtime
ansible -i $( INVENTAIRE_PRODUCTION) $( LIMITE) -b -m command -a "whoami"
faits : ansible -runtime
ansible -i $( INVENTAIRE_PRODUCTION) $( LIMITE) -m setup -a "filter=ansible_distribution*"
verifier-hote : ansible -runtime
ansible-playbook -i $( INVENTAIRE_PRODUCTION) $( PLAYBOOK_VERIFIER_HOTE) $( OPTIONS_PLAYBOOK)