From d26133790a82e30955aeaa0327a30616788b9aee Mon Sep 17 00:00:00 2001 From: clyhtsuriva Date: Mon, 3 Feb 2025 13:01:33 +0100 Subject: opentofu: main becomes docker-server, starting ubuntu and k8s cluster template --- opentofu/outputs.tf | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'opentofu/outputs.tf') diff --git a/opentofu/outputs.tf b/opentofu/outputs.tf index 49e86c5..7779a10 100644 --- a/opentofu/outputs.tf +++ b/opentofu/outputs.tf @@ -1,4 +1,13 @@ -output "vm_ip" { - description = "IP address of the provisioned VM" - value = proxmox_vm_qemu.docker_server.default_ipv4_address +locals { + all_vms = flatten([ + [proxmox_vm_qemu.k8s_cp], + proxmox_vm_qemu.k8s_worker, + [proxmox_vm_qemu.docker_server], + [proxmox_vm_qemu.ubuntu_server_noble] + ]) +} + +output "vm_ips" { + description = "Mapping of VM names to their IP addresses" + value = { for vm in local.all_vms : vm.name => vm.default_ipv4_address if can(vm.default_ipv4_address) } } -- cgit v1.2.3