mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-07-26 07:58:14 +00:00
8c963fb684
Provisions a throwaway nested Proxmox VE instance on an existing host using bpg/proxmox provider. Includes unattended install via answer file, API wait script, and automatic API token creation. Designed for CI-driven integration test environments. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
23 lines
579 B
Bash
Executable File
23 lines
579 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
HOST="$1"
|
|
PORT="${2:-8006}"
|
|
MAX_WAIT="${3:-600}"
|
|
INTERVAL=10
|
|
|
|
echo "Waiting for PVE API at https://${HOST}:${PORT}..."
|
|
elapsed=0
|
|
while [ $elapsed -lt $MAX_WAIT ]; do
|
|
if curl -sk --connect-timeout 5 "https://${HOST}:${PORT}/api2/json/version" 2>/dev/null | grep -q '"version"'; then
|
|
echo "PVE API is responsive after ${elapsed}s"
|
|
exit 0
|
|
fi
|
|
echo " Not ready yet (${elapsed}s elapsed)..."
|
|
sleep $INTERVAL
|
|
elapsed=$((elapsed + INTERVAL))
|
|
done
|
|
|
|
echo "ERROR: PVE API not responsive after ${MAX_WAIT}s"
|
|
exit 1
|