Phase 3: unattended install, seed ISOs and VM lifecycle
autounattend template (q35/AHCI/e1000, no virtio injection), per-VM seed ISOs with a bootstrap that configures the static IP, enables WinRM/RDP and chains into the role script. build --dry-run, up/down/status/vnc verbs. Static addressing happens in PowerShell rather than in the unattend file: Microsoft-Windows-TCPIP matches adapters by connection name and fails silently when the name differs.
This commit is contained in:
@@ -14,6 +14,12 @@ source "$LAB_DIR/lib/check.sh"
|
||||
source "$LAB_DIR/lib/cmd_init.sh"
|
||||
# shellcheck source=lib/cmd_web.sh
|
||||
source "$LAB_DIR/lib/cmd_web.sh"
|
||||
# shellcheck source=lib/cmd_isos.sh
|
||||
source "$LAB_DIR/lib/cmd_isos.sh"
|
||||
# shellcheck source=lib/cmd_seeds.sh
|
||||
source "$LAB_DIR/lib/cmd_seeds.sh"
|
||||
# shellcheck source=lib/cmd_build.sh
|
||||
source "$LAB_DIR/lib/cmd_build.sh"
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
@@ -30,12 +36,15 @@ Options:
|
||||
Commands:
|
||||
check preflight: host, KVM, storage, network, config
|
||||
init create the storage layout
|
||||
isos download the Windows media into LAB_ISO_CACHE
|
||||
seeds render unattend files and pack the seed ISOs
|
||||
build create VMs, run unattended installs (phase 3)
|
||||
provision run role scripts over WinRM (phase 5)
|
||||
snapshot freeze a clean baseline (phase 8)
|
||||
up, down start / stop the VMs (phase 3)
|
||||
reset revert to baseline (phase 8)
|
||||
status VM table (phase 8)
|
||||
status VM table: state, pid, VNC display
|
||||
vnc open a console on a VM
|
||||
web sync the archived site to FS01 (phase 7)
|
||||
doctor participant connectivity checklist (phase 8)
|
||||
peers WireGuard peer configs (proxmox only) (phase 11)
|
||||
@@ -86,7 +95,11 @@ while (( $# > 0 )); do
|
||||
break
|
||||
;;
|
||||
-*)
|
||||
die "unknown option: $1 (try --help)"
|
||||
# Before the command this is a typo; after it, the flag belongs to the verb.
|
||||
if [[ -z $cmd ]]; then
|
||||
die "unknown option: $1 (try --help)"
|
||||
fi
|
||||
break
|
||||
;;
|
||||
*)
|
||||
if [[ -z $cmd ]]; then
|
||||
@@ -119,19 +132,23 @@ esac
|
||||
|
||||
# ------------------------------------------------------------------ dispatch
|
||||
case $cmd in
|
||||
check) cmd_check || exit $? ;;
|
||||
init) cmd_init ;;
|
||||
build) planned build "phase 3" ;;
|
||||
provision) planned provision "phase 5" ;;
|
||||
snapshot) planned snapshot "phase 8" ;;
|
||||
up|down) planned "$cmd" "phase 3" ;;
|
||||
reset) planned reset "phase 8" ;;
|
||||
status) planned status "phase 8" ;;
|
||||
web) cmd_web ;;
|
||||
doctor) planned doctor "phase 8" ;;
|
||||
peers) planned peers "phase 11" ;;
|
||||
check) cmd_check || exit $? ;;
|
||||
init) cmd_init "$@" ;;
|
||||
isos) cmd_isos "$@" ;;
|
||||
seeds) cmd_seeds "$@" ;;
|
||||
web) cmd_web "$@" ;;
|
||||
build) cmd_build "$@" ;;
|
||||
up) cmd_up "$@" ;;
|
||||
down) cmd_down "$@" ;;
|
||||
status) cmd_status "$@" ;;
|
||||
vnc) cmd_vnc "$@" ;;
|
||||
provision) planned provision "phase 5" ;;
|
||||
snapshot) planned snapshot "phase 8" ;;
|
||||
reset) planned reset "phase 8" ;;
|
||||
doctor) planned doctor "phase 8" ;;
|
||||
peers) planned peers "phase 11" ;;
|
||||
export-kali) planned export-kali "phase 9" ;;
|
||||
answers) planned answers "phase 9" ;;
|
||||
destroy) planned destroy "phase 8" ;;
|
||||
*) die "unknown command: ${cmd} (try --help)" ;;
|
||||
answers) planned answers "phase 9" ;;
|
||||
destroy) planned destroy "phase 8" ;;
|
||||
*) die "unknown command: ${cmd} (try --help)" ;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user