Bascule d'instance (make instance-utiliser) + identité relative à l'inventaire
make instance-utiliser NOM=… repointe le symlink 'instance' (prod ↔ bac à sable) ; make instance-courante affiche le montage. Le panneau Intrants lit l'identité dans group_vars/all/10-intrants.yml de l'inventaire monté (réel ou symlink partagé), donc compatible avec la séparation par instance comme avec l'ancien partage lab/production. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
0e7cefbb2f
commit
e57d2c265a
3 changed files with 27 additions and 5 deletions
14
Makefile
14
Makefile
|
|
@ -191,9 +191,21 @@ test:
|
|||
.PHONY: verifier
|
||||
verifier: lint test inventaire-verifier syntaxe
|
||||
|
||||
.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
|
||||
.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 instance-utiliser instance-courante
|
||||
inventaire: inventaire-production
|
||||
|
||||
# Bascule le symlink 'instance' vers un autre dépôt d'instance (séparation par
|
||||
# instance : prod vs bac à sable). Ex. : make instance-utiliser NOM=OPS-Chezlepro-lab
|
||||
instance-utiliser:
|
||||
@if [[ -z "$(NOM)" ]]; then printf '%s\n' "Usage: make instance-utiliser NOM=<dossier-frère> (ex. OPS-Chezlepro-lab)"; exit 2; fi
|
||||
@if [[ ! -d "../$(NOM)" ]]; then printf '%s\n' "Introuvable: ../$(NOM)"; exit 2; fi
|
||||
@if [[ -e instance && ! -L instance ]]; then printf '%s\n' "Refus: 'instance' existe et n'est pas un symlink."; exit 2; fi
|
||||
@rm -f instance && ln -s "../$(NOM)" instance
|
||||
@printf 'instance -> %s\n' "$$(readlink instance)"
|
||||
|
||||
instance-courante:
|
||||
@printf 'instance -> %s\n' "$$(readlink instance 2>/dev/null || echo '(non monté)')"
|
||||
|
||||
config:
|
||||
python3 scripts/config_proxmox.py
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue