diff --git a/proxmox/data.tf b/proxmox/data.tf index 1c58a03..aef4a18 100644 --- a/proxmox/data.tf +++ b/proxmox/data.tf @@ -14,13 +14,13 @@ data "dns_aaaa_record_set" "cluster_api" { } data "dns_a_record_set" "guests" { - for_each = [ for guest in var.vm_guests: "${guest.name}.${var.local_domain}" ] - host = each.value + for_each = toset([ for guest in var.vm_guests: guest.name ]) + host = "${each.value}.${var.local_domain}" } data "dns_aaaa_record_set" "guests" { - for_each = [ for guest in var.vm_guests: "${guest.name}.${var.local_domain}" ] - host = each.value + for_each = toset([ for guest in var.vm_guests: guest.name ]) + host = "${each.value}.${var.local_domain}" } diff --git a/proxmox/files.tf b/proxmox/files.tf index 9c461be..16814dd 100644 --- a/proxmox/files.tf +++ b/proxmox/files.tf @@ -36,7 +36,7 @@ resource "proxmox_virtual_environment_file" "talos_cloud_init" { for_each = { for guest in var.vm_guests: guest.name => guest if contains(["controlplane", "worker"], guest.role) } content_type = "snippets" datastore_id = "local" - node_name = each.value.node + node_name = each.value.host overwrite = true source_raw { data = data.talos_machine_configuration.this[each.key].machine_configuration diff --git a/proxmox/network.auto.tfvars b/proxmox/network.auto.tfvars index a3d6c7c..167ef50 100644 --- a/proxmox/network.auto.tfvars +++ b/proxmox/network.auto.tfvars @@ -5,7 +5,7 @@ ipv4_nameservers = [ {address = "10.96.10.254"} ] ipv6_nameservers = [ - {address = "2600:4040:593d:8b10::53"} + {address = "2600:4040:593d:8b10:6662:66ff:fe21:e9c4"} ] local_domain = "balsillie.house" search_domains = [ diff --git a/proxmox/providers.tf b/proxmox/providers.tf index ce648c7..7342b0f 100644 --- a/proxmox/providers.tf +++ b/proxmox/providers.tf @@ -7,7 +7,8 @@ provider "proxmox" { random_vm_id_end = 99999 ssh { username = "ladmin" - agent = true + # SSH Private Key provided by env var PROXMOX_VE_SSH_PRIVATE_KEY + agent = false node_address_source = "dns" node { name = "hv01" diff --git a/proxmox/templates/talos_cluster_config.yml.tftpl b/proxmox/templates/talos_cluster_config.yml.tftpl index 7fd338b..a0ec46c 100644 --- a/proxmox/templates/talos_cluster_config.yml.tftpl +++ b/proxmox/templates/talos_cluster_config.yml.tftpl @@ -38,5 +38,5 @@ cluster: - name: contents: adminKubeconfig: - certLifetime: 10y + certLifetime: "87600h" # 10 years (24 hours * 365 * 10) allowSchedulingOnControlPlanes: false diff --git a/proxmox/templates/talos_hostname_config.yml.tftpl b/proxmox/templates/talos_hostname_config.yml.tftpl index 0cf9282..b9def78 100644 --- a/proxmox/templates/talos_hostname_config.yml.tftpl +++ b/proxmox/templates/talos_hostname_config.yml.tftpl @@ -2,5 +2,5 @@ apiVersion: v1alpha1 kind: HostnameConfig -hostname: ${hostname}.$(local_domain) +hostname: ${hostname}.${local_domain} auto: off \ No newline at end of file diff --git a/proxmox/templates/talos_machine_config.yml.tftpl b/proxmox/templates/talos_machine_config.yml.tftpl index d7b42a4..7e7424e 100644 --- a/proxmox/templates/talos_machine_config.yml.tftpl +++ b/proxmox/templates/talos_machine_config.yml.tftpl @@ -17,7 +17,8 @@ machine: grubUseUKICmdline: true legacyBIOSSupport: false features: - kubernetesTalosAPIAccess: false + kubernetesTalosAPIAccess: + enabled: false diskQuotaSupport: false kubePrism: enabled: false diff --git a/proxmox/variables.tf b/proxmox/variables.tf index e33b286..2a16be5 100644 --- a/proxmox/variables.tf +++ b/proxmox/variables.tf @@ -2,10 +2,7 @@ variable "vm_guests" { type = list(object({ name = string host = string - ipv4_address = string role = string - cpu = number - memory = number })) }