Prérequis & Contexte
Doc d’entrée minfra-v2. Lire avant toute opération de redéploiement.
Contexte
Plateforme IaC 100% (Terraform, Ansible, Packer, Docker). Périmètre : salon + garage, 2 switches manageables 802.1Q, NAS Synology jedha (10.0.1.20), hyperviseur Proxmox (coruscant 10.0.1.30), Mac Mini endor (10.0.1.15). Domaine interne minfra.in via Unbound OPNsense. Convention Star Wars.
Deux profils clients admin supportés : Windows (PowerShell + Chocolatey + WSL Ubuntu pour Ansible) ou Linux (Debian/Ubuntu natif, ou macOS via Homebrew).
Installer Chocolatey {os:windows}
Gestionnaire de paquets Windows. Prérequis à toutes les installations Windows suivantes.
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Verify: choco —version
Installer WSL Ubuntu {os:windows}
Ansible ne tourne pas natif Windows → besoin WSL.
# PowerShell admin
wsl --install -d Ubuntu
wsl --set-default-version 2
Verify: wsl -l -v
Installer mise (gestionnaire versions)
mise pin toutes versions outillage depuis .mise.toml. Choisir une variante selon ton client.
# === Windows (Chocolatey) ===
choco install mise -y
# === Linux / macOS / WSL ===
curl https://mise.run | sh
echo 'eval "$(mise activate bash)"' >> ~/.bashrc
source ~/.bashrc
Verify: mise —version
Installer Task (go-task)
Runner de tâches projet (Taskfile.yml).
# === Windows (Chocolatey) ===
choco install go-task -y
# === Linux / macOS / WSL ===
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
Verify: task —version
Installer outils via mise
Installe toutes versions définies dans .mise.toml du repo (terraform, packer, sops, node, python, kubectl, helm). Identique Windows/Linux.
cd D:\git\minfra-v2 # Windows
cd ~/git/minfra-v2 # Linux/macOS
mise trust
mise install
Verify: mise list Verify: terraform version Verify: packer version Verify: sops —version
Installer Ansible {os:linux}
Ansible tourne uniquement sur POSIX. Sur Windows : lancer cette commande depuis WSL Ubuntu (installé plus haut).
# === Linux / macOS / WSL Ubuntu ===
sudo apt update && sudo apt install -y python3-pip
pip install ansible --break-system-packages
Verify: ansible —version
Installer Bitwarden CLI
Récupération clés sources (age, SSH) depuis vault perso.
# === Windows (Chocolatey) ===
choco install bitwarden-cli -y
# === Linux ===
sudo snap install bw
# === macOS ===
brew install bitwarden-cli
Verify: bw —version
Installer age + pre-commit
Chiffrement secrets repo (age) + hooks git (pre-commit).
# === Windows (Chocolatey) ===
choco install age.portable -y
pip install pre-commit
# === Linux / WSL ===
sudo apt install -y age
pip install pre-commit --break-system-packages
# === macOS ===
brew install age
pip install pre-commit
Verify: age —version Verify: pre-commit —version
Configurer SOPS + clé age
Identique Windows/Linux. Sur Windows lancer dans WSL Ubuntu.
# Récupérer la clé age depuis Bitwarden (item "age-key-minfra")
bw login
bw unlock
mkdir -p ~/.config/sops/age
bw get notes "age-key-minfra" > ~/.config/sops/age/keys.txt
chmod 600 ~/.config/sops/age/keys.txt
Verify: sops -d infra/ansible/inventory/secrets/git-tokens.yml | head -1
Setup hooks pre-commit
cd D:\git\minfra-v2 # Windows
cd ~/git/minfra-v2 # Linux/macOS
pre-commit install
pre-commit run --all-files
Verify: ls .git/hooks/pre-commit
Hors périmètre (Phase 2)
- Cluster K8s (L9) — différé après stabilisation L0-L8.
- VLAN 40 IoT/Gaming + VLAN 50 Invités — à déployer plus tard.
- Wi-Fi AP dédié — pas encore acheté.
- Redondance lien Salon ↔ Garage — second câble à prévoir.