homelab_cluster/tofu/outputs.tf

18 lines
629 B
HCL

output "server_ip" {
description = "IP address of the K3s server node."
value = libvirt_domain.server.network_interface[0].addresses[0]
}
output "agent_ips" {
description = "List of IP addresses of the K3s agent nodes."
value = [libvirt_domain.agent.network_interface[0].addresses[0]]
}
resource "local_file" "ansible_inventory" {
content = templatefile("${path.module}/inventory.ini.tpl", {
server_ip = libvirt_domain.server.network_interface[0].addresses[0]
agent_ips = [libvirt_domain.agent.network_interface[0].addresses[0]]
ssh_user = var.vm_user
})
filename = "../ansible/inventory.ini"
}