- Add .gitignore: exclude compiled binaries, build artifacts, and Helm values files containing real secrets (authentik, prometheus) - Add all Kubernetes deployment manifests (deployment/) - Add services source code: ha-sync, device-inventory, games-console, paperclip, parts-inventory - Add Ansible orchestration: playbooks, roles, inventory, cloud-init - Add hardware specs, execution plans, scripts, HOMELAB.md - Add skills/homelab/SKILL.md + skills/install.sh to preserve Copilot skill - Remove previously-tracked inventory-cli binary from git index Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
26 lines
635 B
Bash
Executable file
26 lines
635 B
Bash
Executable file
#/bin/bash
|
|
SSH="ssh hp"
|
|
list=`$SSH qm list | awk 'NR>1 && $3=="running" {print $1}'`
|
|
for vmid in $list; do
|
|
echo "Gracefully rebooting VM $vmid..."
|
|
$SSH qm reboot $vmid
|
|
# Wait up to 30s for VM to cycle through stopped state
|
|
elapsed=0
|
|
rebooted=false
|
|
while [[ $elapsed -lt 30 ]]; do
|
|
sleep 1; elapsed=$((elapsed + 2))
|
|
status=$($SSH qm status $vmid | awk '{print $2}')
|
|
if [[ "$status" == "stopped" ]]; then
|
|
rebooted=true
|
|
break
|
|
fi
|
|
done
|
|
|
|
if $rebooted; then
|
|
echo "VM $vmid rebooted gracefully"
|
|
else
|
|
echo "VM $vmid timed out — performing hard reset..."
|
|
$SSH qm reset $vmid
|
|
fi
|
|
done
|
|
|