From 4e2703c52026009c34e8dcb8294b50881f9152f8 Mon Sep 17 00:00:00 2001 From: clyhtsuriva Date: Mon, 3 Feb 2025 17:21:58 +0100 Subject: opentofu: add kubespray submodule to deploy via ansible Not working yet, getting : "msg": "Ansible must be between 2.16.4 and 2.17.0 exclusive - you have 2.17.5" --- opentofu/inventory.tf | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 opentofu/inventory.tf (limited to 'opentofu/inventory.tf') diff --git a/opentofu/inventory.tf b/opentofu/inventory.tf new file mode 100644 index 0000000..ddf3ba4 --- /dev/null +++ b/opentofu/inventory.tf @@ -0,0 +1,18 @@ +resource "local_file" "ansible_inventory" { + filename = "${path.module}/inventory.ini" + content = <<-EOT + [kube_control_plane] + ${proxmox_vm_qemu.k8s_cp.default_ipv4_address} + + [etcd] + ${proxmox_vm_qemu.k8s_cp.default_ipv4_address} + + [kube_node] + %{for vm in proxmox_vm_qemu.k8s_worker[*]}${vm.default_ipv4_address} + %{endfor} + + [k8s_cluster:children] + kube_control_plane + kube_node + EOT +} -- cgit v1.2.3