ci: initial cluster state

This commit is contained in:
Patryk Hegenberg 2025-05-06 06:40:17 +02:00
commit 3b54d183c5
8 changed files with 500 additions and 0 deletions

18
tofu/outputs.tf Normal file
View file

@ -0,0 +1,18 @@
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"
}