infra: HA-Ressource und Node-Affinity per pve-host statt tofu, Infra-IP im Inventar
ci / test (push) Successful in 29s
ci / test (push) Successful in 29s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
23d6e36028
commit
bf20da1629
@@ -13,14 +13,17 @@ output "gpu_vms" {
|
||||
}
|
||||
|
||||
output "infra_containers" {
|
||||
value = { for k, v in proxmox_virtual_environment_container.infra : k => { node = v.node_name, vmid = v.vm_id } }
|
||||
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
|
||||
} } } }
|
||||
all = { children = {
|
||||
gpu_vms = { hosts = { for k, ip in local.gpu_vm_ipv4 : k => { ansible_host = ip } if ip != null } }
|
||||
infra = { hosts = {
|
||||
for k, v in proxmox_virtual_environment_container.infra : k => { ansible_host = v.ipv4["eth0"] } if try(v.ipv4["eth0"], null) != null
|
||||
} }
|
||||
} }
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user