Files
cluster-knaster/platform/proxmox/tofu/outputs.tf
Robert RappandClaude Fable 5.1 7d889344bd
ci / test (push) Failing after 25s
ci / test (pull_request) Failing after 26s
Hindsight-LXC: Container hindsight (pve52, HA, .185), Rolle hindsight-stack, Firewall, Prometheus-Ziel, embed-default gebunden (Auftrag 22.10.)
Task 6.1 ist seit 19.10. in k3s live (embed-default/rerank-default in gpu-pve44/46, Adressen .186/.178);
Task 6.3 (LiteLLM-Slots) läuft als PR im Workflows-Repo. Entscheidungen und offene Schritte außerhalb des Repos
(tofu apply, Playbooks, Portainer, DHCP-Reservierung) in docs/auftraege/2026-10-22-hindsight-cluster.md,
Betrieb in docs/BETRIEB.md Abschnitt 16.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-22 19:33:29 +02:00

45 lines
2.2 KiB
Terraform

locals {
# Erste IPv4 der Gast-Netzkarte laut qemu-guest-agent (ohne lo, Docker- und Bridge-Interfaces)
gpu_vm_ipv4 = {
for k, v in proxmox_virtual_environment_vm.gpu : k => try(flatten([
for i, name in v.network_interface_names : v.ipv4_addresses[i]
if !contains(["lo"], name) && !startswith(name, "docker") && !startswith(name, "br-") && !startswith(name, "veth") && !startswith(name, "cni") && !startswith(name, "flannel")
])[0], null)
}
svc_vm_ipv4 = {
for k, v in proxmox_virtual_environment_vm.svc : k => try(flatten([
for i, name in v.network_interface_names : v.ipv4_addresses[i]
if !contains(["lo"], name) && !startswith(name, "docker") && !startswith(name, "br-") && !startswith(name, "veth") && !startswith(name, "cni") && !startswith(name, "flannel")
])[0], null)
}
}
output "service_vms" {
value = { for k, v in proxmox_virtual_environment_vm.svc : k => { node = v.node_name, vmid = v.vm_id, ipv4 = local.svc_vm_ipv4[k] } }
}
output "gpu_vms" {
value = { for k, v in proxmox_virtual_environment_vm.gpu : k => { node = v.node_name, vmid = v.vm_id, ipv4 = local.gpu_vm_ipv4[k] } }
}
output "infra_containers" {
value = { for k, v in proxmox_virtual_environment_container.infra : k => { node = v.node_name, vmid = v.vm_id, ipv4 = try(v.ipv4["eth0"], null) } }
}
# tofu output -raw ansible_inventory > ../ansible/inventory.generated.yml
output "ansible_inventory" {
value = yamlencode({
all = { children = {
gpu_vms = { hosts = { for k, ip in local.gpu_vm_ipv4 : k => { ansible_host = ip } if ip != null } }
service_vms = { hosts = { for k, ip in local.svc_vm_ipv4 : k => { ansible_host = ip } if ip != null } }
# je Container eine Gruppe mit seinem Namen (infra, hindsight): site.yml spielt infra-stack nur auf infra
infra = { hosts = {
for k, v in proxmox_virtual_environment_container.infra : k => { ansible_host = v.ipv4["eth0"] } if k == "infra" && try(v.ipv4["eth0"], null) != null
} }
hindsight = { hosts = {
for k, v in proxmox_virtual_environment_container.infra : k => { ansible_host = v.ipv4["eth0"] } if k == "hindsight" && try(v.ipv4["eth0"], null) != null
} }
} }
})
}