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:
2026-10-22 19:23:16 -04:00
parent 538fb9a117
commit 890dd58700
349 changed files with 1142 additions and 2236 deletions
+51
View File
@@ -0,0 +1,51 @@
# shellcheck shell=bash
# cmd_isos — fetch the Windows media into LAB_ISO_CACHE.
# Read-only content, so an NTFS/FUSE cache directory is fine here.
# name|url|minimum size in MB
ISO_ITEMS=(
"SERVER_EVAL_x64FRE_en-us.iso|https://go.microsoft.com/fwlink/?linkid=2195280|2000"
"virtio-win.iso|https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso|200"
)
cmd_isos() {
have_cmd curl || die "curl is required"
mkdir -p "$LAB_ISO_CACHE" || die "cannot create $LAB_ISO_CACHE"
local item name url min_mb target tmp size_mb
for item in "${ISO_ITEMS[@]}"; do
IFS='|' read -r name url min_mb <<< "$item"
target="$LAB_ISO_CACHE/$name"
tmp="$target.part"
if [[ -f $target ]]; then
size_mb=$(( $(stat -c %s "$target") / 1024 / 1024 ))
if (( size_mb >= min_mb )); then
ok "$name present (${size_mb} MB)"
continue
fi
warn "$name is only ${size_mb} MB, re-downloading"
rm -f "$target"
fi
step "download $name"
info " from $url"
local curl_opts=(-L --fail --retry 3 --retry-delay 5 -C - -o "$tmp")
if [[ -t 1 ]]; then
curl "${curl_opts[@]}" --progress-bar "$url" || { rm -f "$tmp"; die "download failed: $name"; }
else
curl "${curl_opts[@]}" -sS "$url" || { rm -f "$tmp"; die "download failed: $name"; }
fi
mv -f "$tmp" "$target"
size_mb=$(( $(stat -c %s "$target") / 1024 / 1024 ))
if (( size_mb < min_mb )); then
die "$name looks truncated: ${size_mb} MB (expected >= ${min_mb} MB)"
fi
ok "$name ready (${size_mb} MB)"
done
printf '\n'
ok "ISO cache complete: ${LAB_ISO_CACHE}"
}