ci / test (push) Failing after 22s
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
45 lines
2.3 KiB
Bash
Executable File
45 lines
2.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Zugang zu den GPU-VMs und Infra-Containern auffrischen (läuft auf ops, im Verzeichnis platform/proxmox/tofu, mit
|
|
# geladenem /root/.config/knaster/tofu.env). Nötig nach jedem VM-Neustart, solange die Gäste per
|
|
# DHCP ohne Reservierung laufen (D5): Adressen können wechseln (12.10. zwei VMs vertauscht).
|
|
#
|
|
# 1. aktuelle Adressen per qemu-guest-agent in den tofu-State holen (refresh-only)
|
|
# 2. ../ansible/inventory.generated.yml neu schreiben
|
|
# 3. Hostschlüssel über den Agenten lesen (Vertrauensweg Proxmox statt ssh-keyscan) und in
|
|
# ~/.ssh/known_hosts eintragen; vorher wartet das Skript, bis cloud-init fertig ist.
|
|
set -euo pipefail
|
|
|
|
tofu apply -refresh-only -auto-approve -input=false -no-color >/dev/null
|
|
tofu output -raw ansible_inventory > ../ansible/inventory.generated.yml
|
|
|
|
# GPU-VMs und Dienst-VMs (k3s, D6) gleich behandeln
|
|
{ tofu output -json gpu_vms; tofu output -json service_vms; } | python3 -c '
|
|
import json, sys
|
|
for blob in sys.stdin.read().replace("}
|
|
{", "} |