From 1dec2984b5552d2b58a981e65189ffbbacb9f103 Mon Sep 17 00:00:00 2001 From: youness-adm Date: Mon, 27 Apr 2026 02:43:21 +0200 Subject: [PATCH] Ajouter docs/installation.md --- docs/installation.md | 100 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 docs/installation.md diff --git a/docs/installation.md b/docs/installation.md new file mode 100644 index 0000000..46df9a2 --- /dev/null +++ b/docs/installation.md @@ -0,0 +1,100 @@ +# Installation + +## 1. Cloner le dépôt + +### Sur la machine INFRA (Proxmox) +```bash +cd ~ +git clone https://gitea.ephaitek.com/ephaitek/ephaitek-provisioning.git +chmod +x ephaitek-provisioning/scripts/infra/deploy-vm.sh +``` + +### Sur la machine ADMIN +```bash +cd /root/admin_tools +git clone https://gitea.ephaitek.com/ephaitek/ephaitek-provisioning.git post-provision +chmod +x post-provision/scripts/admin/run-all.sh +chmod +x post-provision/scripts/admin/steps/*.sh +``` + +--- + +## 2. Installer les dépendances (machine ADMIN) + +```bash +dnf install -y expect sshpass bind-utils nc +``` + +--- + +## 3. Configurer le CA cert Vault + +```bash +mkdir -p /root/admin_tools/pki + +# Récupérer le certificat root CA depuis Vault +ssh root@10.100.0.42 -p 2242 \ + "vault read -field=certificate pki/cert/ca" \ + > /root/admin_tools/pki/root.crt + +chmod 644 /root/admin_tools/pki/root.crt + +# Vérifier +openssl x509 -in /root/admin_tools/pki/root.crt -noout -subject -dates +``` + +--- + +## 4. Vérifier les accès SSH + +```bash +# NS1 +ssh -p 2260 root@ns1.adm "echo OK" + +# pfSense +ssh -p 2266 admin@10.11.0.1 "echo OK" +``` + +Si pfSense refuse la connexion par clé, ajouter la clé publique dans l'UI : +**System → User Manager → admin → Authorized SSH Keys** +```bash +cat ~/.ssh/id_ed25519.pub +``` + +--- + +## 5. Vérifier les scripts admin_tools + +```bash +for script in \ + /root/admin_tools/majdns/dns1maj.sh \ + /root/admin_tools/fwdeploy/provision_pfsense_vlan_interactivev2.sh \ + /root/admin_tools/deploy_splitdns_adminkey/deploy-dns-keyv3.sh; do + [[ -x "$script" ]] && echo "✔ $script" || echo "✖ MANQUANT: $script" +done +``` + +--- + +## 6. Test en dry-run + +```bash +cd /root/admin_tools/post-provision/scripts/admin + +# Simulation sans aucune modification +./run-all.sh --vmid 9999 --name test --vlan 99 --dry-run +``` + +Résultat attendu : toutes les étapes affichées avec `[DRY-RUN]`, aucune erreur. + +--- + +## 7. Mettre à jour + +```bash +# INFRA +cd ~/ephaitek-provisioning && git pull + +# ADMIN +cd /root/admin_tools/post-provision && git pull +``` \ No newline at end of file