alliance-boreale/docs/architecture/readme_package.md
Dan Allaire e704e1cc39
Some checks failed
CI / yaml-lint (push) Has been cancelled
CI / ssot-export (push) Has been cancelled
CI / tests (push) Has been cancelled
CI / docs (push) Has been cancelled
normes et nomenclature mnémotechnique
2025-10-21 11:09:16 -04:00

6.5 KiB

Package Complet - Nomenclature v2.0

L'Alliance Boréale

Version : 1.0
Date : 21 octobre 2025
Licence : AGPL-3.0 (code) / CC-BY-SA 4.0 (documentation)


📦 Contenu du Package

Ce package complet contient tout ce dont vous avez besoin pour adopter le Standard de Nomenclature v2.0 dans votre infrastructure Proxmox.

📚 Documentation (5 documents)

  1. Standard de Nomenclature v2.0 (60+ pages)

    • Spécification complète du standard
    • Format VMID, IP, noms VMs, DNS
    • Tables de correspondance exhaustives
    • Procédures opérationnelles
  2. Scripts de Migration et d'Audit (documentation + 6 scripts)

    • audit-nomenclature.sh - Audit de conformité
    • generate-dns-records.sh - Génération zone DNS
    • generate-inventory.sh - Génération inventaire Ansible
    • migrate-vm.sh - Migration assistée
    • validate-vmid.sh - Validation VMID
    • allocate-ip.sh - Allocation IP tenants
  3. Guide de Formation (40+ pages)

    • Formation complète 2-3 heures
    • 8 exercices pratiques avec solutions
    • Aide-mémoire imprimable
    • Test de certification (10 questions)
  4. Templates Ansible & Terraform

    • Modules Ansible (création VM, audit, compliance)
    • Modules Terraform (infra + tenants)
    • Exemples d'utilisation
    • Makefile d'automatisation
  5. README Package (ce document)

    • Vue d'ensemble
    • Quick Start
    • Troubleshooting

🚀 Quick Start (15 minutes)

Étape 1 : Installation des Scripts

# Télécharger le package
wget https://forge.alliance-boreale.ca/nomenclature-v2-package.tar.gz
tar xzf nomenclature-v2-package.tar.gz
cd nomenclature-v2

# Installer les scripts
sudo bash scripts/install-nomenclature-tools.sh

# Configuration
# Suivre les prompts pour MEMBER_ID et DNS_DOMAIN

Étape 2 : Premier Audit

# Lancer un audit de conformité
audit-nomenclature.sh

# Résultat attendu :
# ✅ VMs conformes : X
# ❌ VMs non conformes : Y
# Taux de conformité: Z%

Étape 3 : Validation d'un VMID

# Tester la validation
validate-vmid.sh 02001

# Résultat :
# ✅ VMID VALIDE
# Type: Infrastructure
# Couche: 2 (Réseau)

Étape 4 : Première Migration (Simulation)

# Migration en mode dry-run
DRY_RUN=true migrate-vm.sh 104 10001 \
  czp-t001-web-prod-01 10.0.10.1

# Vérifier la sortie avant de lancer en réel

Étape 5 : Documentation

# Lire le standard complet
less docs/Standard_Nomenclature_v2.0.md

# Lire le guide de formation
less docs/Guide_Formation_v2.0.md

📖 Structure du Package

nomenclature-v2/
│
├── README.md                          # Ce fichier
├── LICENSE                            # AGPL-3.0
│
├── docs/
│   ├── Standard_Nomenclature_v2.0.md  # Spec complète
│   ├── Guide_Formation_v2.0.md        # Formation
│   └── aide-memoire.pdf               # Carte de référence
│
├── scripts/
│   ├── install-nomenclature-tools.sh  # Installation
│   ├── audit-nomenclature.sh          # Audit
│   ├── generate-dns-records.sh        # DNS
│   ├── generate-inventory.sh          # Inventaire
│   ├── migrate-vm.sh                  # Migration
│   ├── validate-vmid.sh               # Validation
│   └── allocate-ip.sh                 # Allocation IP
│
├── ansible/
│   ├── inventory/
│   │   └── proxmox.yml                # Inventaire dynamique
│   ├── playbooks/
│   │   ├── create-infra-vm.yml        # Création VM infra
│   │   ├── create-tenant-vm.yml       # Création VM tenant
│   │   └── audit-nomenclature.yml     # Audit Ansible
│   └── roles/
│       └── nomenclature_compliance/   # Role de conformité
│
├── terraform/
│   ├── modules/
│   │   ├── infra-vm/                  # Module VM infrastructure
│   │   └── tenant-vm/                 # Module VM tenant
│   ├── examples/
│   │   ├── bronze-infra/              # Infrastructure Bronze
│   │   ├── silver-infra/              # Infrastructure Argent
│   │   └── tenant-stack/              # Stack tenant complète
│   ├── main.tf                        # Exemple principal
│   ├── variables.tf                   # Variables
│   └── outputs.tf                     # Outputs
│
├── templates/
│   ├── vm-creation-request.md         # Template demande création VM
│   ├── migration-plan.md              # Template plan de migration
│   └── compliance-report.md           # Template rapport conformité
│
└── examples/
    ├── infrastructure-bronze.txt      # Exemple infra Bronze
    ├── infrastructure-gold.txt        # Exemple infra Or
    └── tenant-multiservice.txt        # Exemple tenant complet

💡 Cas d'Usage

1. Audit de Conformité de l'Existant

# Lancer audit
audit-nomenclature.sh > audit-$(date +%Y%m%d).log

# Analyser le rapport CSV
grep "NON CONFORME" /tmp/audit-nomenclature-*.csv

# Créer plan de migration
cat audit-*.log | grep "NON CONFORME" > migration-todo.txt

2. Création Nouvelle VM Infrastructure

Option A : Script interactif

ansible-playbook ansible/playbooks/create-infra-vm.yml
# Suivre les prompts

Option B : Terraform

cd terraform/examples/bronze-infra
terraform init
terraform plan
terraform apply

Option C : Manuel

# 1. Déterminer VMID
validate-vmid.sh 02003  # DNS Slave 3

# 2. Créer VM
qm create 02003 \
  --name czp-infra-dns-slave3-prod-01 \
  --clone debian-12-template \
  --net0 virtio,bridge=vmbr0,tag=2 \
  --ipconfig0 ip=10.0.2.12/24,gw=10.0.0.1

# 3. Ajouter DNS
echo "dns-slave3.infra.czp.alliance-boreale.ca. IN A 10.0.2.12" \
  >> /var/lib/alliance-boreale/dns-records.zone

3. Migration Progressive

# Étape 1 : Audit initial
audit-nomenclature.sh

# Étape 2 : Créer plan (fichier CSV)
# migration-plan.csv :
# VMID_SRC,VMID_DST,NAME,IP
# 104,10001,czp-t001-web-prod-01,10.0.10.1
# 105,10011,czp-t001-api-prod-01,10.0.10.3

# Étape 3 : Migrer par lots
while IFS=, read -r src dst name ip; do
  echo "Migration $src -> $dst"
  DRY_RUN=true migrate-vm.sh "$src" "$dst" "$name" "$ip"
  read -p "Continuer? (y/n) " -n 1 -r
  if [[ $REPLY =~ ^[Yy]$ ]]; then
    migrate-vm.sh "$src" "$dst" "$name" "$ip"
  fi
done < migration-plan.csv

4. Déploiement Nouveau Tenant

# Via Ansible
ansible-playbook ansible/playbooks/