Split into qemu and proxmox platforms over a shared content tree
platforms/qemu and platforms/proxmox each have their own lab.sh and lab.conf; content/ holds everything shared (roles, seed, site, helpers). The dispatcher, preflight and command implementations are common and take platform differences from the backend. Proxmox backend: qm create with q35/SATA/e1000, ISOs and seed ISOs in an ISO storage, provisioning over qm guest exec (no Python packages needed on the host), template + clone for reset, and peers/ to emit WireGuard configs. The role scripts now ride on the seed ISO, so provisioning transfers nothing. build-bundle.sh produces a self-contained tarball per platform, for hosts that cannot reach the git server. Both configs are generic: no absolute path from this machine remains.
This commit is contained in:
+72
-1
@@ -13,7 +13,18 @@
|
||||
Les images Windows sont des versions d'évaluation Microsoft : 180 jours pour Server 2022,
|
||||
90 jours pour Windows 11. Elles ne servent qu'au laboratoire.
|
||||
|
||||
## Déploiement complet
|
||||
## Deux plateformes
|
||||
|
||||
Les commandes ci-dessous s'écrivent `./lab.sh` ; préfixez-les par la plateforme visée :
|
||||
|
||||
```bash
|
||||
./platforms/qemu/lab.sh ... # Linux générique avec KVM
|
||||
./platforms/proxmox/lab.sh ... # hôte Proxmox VE
|
||||
```
|
||||
|
||||
Chaque plateforme a son propre `lab.conf` dans son répertoire.
|
||||
|
||||
## Déploiement complet (qemu)
|
||||
|
||||
```bash
|
||||
./lab.sh check # 10 s — valide hôte, stockage, réseau, config
|
||||
@@ -64,6 +75,66 @@ Test-NetConnection 1.1.1.1 -Port 443
|
||||
Test-NetConnection 10.10.10.20 -Port 5985
|
||||
```
|
||||
|
||||
## Déploiement sur Proxmox
|
||||
|
||||
Rien n'est automatisé côté hôte avant `check` : le script **vérifie** la configuration et refuse
|
||||
de continuer si elle ne correspond pas à la machine.
|
||||
|
||||
1. **Remplir `platforms/proxmox/lab.conf`** :
|
||||
|
||||
| Clé | À mettre |
|
||||
|---|---|
|
||||
| `PVE_STORAGE_DISKS` | stockage des disques (`local-lvm`, `local-zfs`…) |
|
||||
| `PVE_STORAGE_ISO` | stockage avec le contenu `iso` (`pvesm status -content iso`) |
|
||||
| `PVE_ISO_DIR` | chemin réel derrière ce stockage (`/var/lib/vz/template/iso` par défaut) |
|
||||
| `PVE_BRIDGE` | `vmbr10` |
|
||||
| `LAB_HOST_IP` | adresse de l'hôte sur ce pont, `10.10.10.1` |
|
||||
| `PVE_VMID_BASE` | premier identifiant de VM libre, `1100` |
|
||||
|
||||
2. **Créer le pont** dans l'interface : nom `vmbr10`, aucun port, `10.10.10.1/24`, pas de
|
||||
passerelle. Le script ne touche jamais à `/etc/network/interfaces`.
|
||||
|
||||
3. **Lancer** :
|
||||
|
||||
```bash
|
||||
cd platforms/proxmox
|
||||
./lab.sh check # qm, stockages, pont, ISO, config
|
||||
./lab.sh init
|
||||
./lab.sh isos # télécharge dans PVE_ISO_DIR
|
||||
./lab.sh build
|
||||
./lab.sh provision
|
||||
./lab.sh web --sync
|
||||
./lab.sh snapshot # convertit les VM en gabarits (ids +100)
|
||||
```
|
||||
|
||||
`reset` détruit la VM et la reclone depuis le gabarit : quelques secondes, pas de réinstallation.
|
||||
|
||||
### Sans accès au serveur git
|
||||
|
||||
Sur un hôte qui ne peut pas cloner le dépôt :
|
||||
|
||||
```bash
|
||||
./build-bundle.sh proxmox # sur votre poste
|
||||
scp dist/norbourg-proxmox.tar.gz root@pve:/root/
|
||||
ssh root@pve 'tar xzf norbourg-proxmox.tar.gz && cd norbourg-proxmox/platforms/proxmox && ./lab.sh check'
|
||||
```
|
||||
|
||||
L'archive contient le contenu commun, la plateforme, la documentation et la solution.
|
||||
|
||||
### Accès des participants : VM routeur WireGuard
|
||||
|
||||
C'est la seule étape manuelle restante. Sur l'hôte Proxmox, créez une petite VM (Alpine ou
|
||||
Debian, 512 Mo) avec deux cartes : `vmbr0` (réseau du bureau) et `vmbr10` (laboratoire). Dans
|
||||
cette VM, installez WireGuard et collez la configuration produite par :
|
||||
|
||||
```bash
|
||||
./platforms/proxmox/lab.sh peers alice bob carol
|
||||
# écrit une config par participant et le wg0.conf du routeur dans $WG_DIR
|
||||
```
|
||||
|
||||
Chaque participant importe son fichier `.conf` : il obtient une adresse dans `10.10.10.0/24` et
|
||||
n'a plus qu'à suivre `docs/prerequis.md` (sans l'étape de route, le tunnel la fournit).
|
||||
|
||||
## Réseau et isolation
|
||||
|
||||
L'hôte a une adresse sur `br-lab` (`10.10.10.230`) et une sur le réseau du bureau. Le pare-feu
|
||||
|
||||
Reference in New Issue
Block a user