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.
34 lines
896 B
Bash
34 lines
896 B
Bash
# shellcheck shell=bash
|
|
# cmd_answers / cmd_destroy — small utilities shared by both platforms.
|
|
|
|
cmd_answers() {
|
|
local file="$ROOT_DIR/answers/walkthrough.md"
|
|
[[ -r $file ]] || die "no answer key at $file"
|
|
cat "$file"
|
|
}
|
|
|
|
cmd_destroy() {
|
|
local name i
|
|
|
|
step "stop"
|
|
for name in "${VM_NAMES[@]}"; do
|
|
backend_stop "$name" >/dev/null 2>&1 || true
|
|
done
|
|
|
|
step "remove"
|
|
for name in "${VM_NAMES[@]}"; do
|
|
backend_destroy "$name" || warn "could not fully remove $name"
|
|
done
|
|
|
|
step "generated artifacts"
|
|
rm -rf "$LAB_ROOT/seeds" "$LAB_ROOT/run" "$LAB_ROOT/provision"
|
|
ok "seed ISOs, runtime state and provisioning scratch removed"
|
|
|
|
printf '\n'
|
|
info "kept: ${LAB_ROOT}/images (baselines), logs, and the ISO cache"
|
|
info "remove those by hand if you really want the space back"
|
|
}
|
|
|
|
# Platforms that support participant tunnels override this.
|
|
cmd_peers() { planned peers; }
|