Files
terraform/proxmox/locals.tf
T

26 lines
1.2 KiB
Terraform
Raw Normal View History

2026-09-01 17:31:47 -04:00
locals {
hv01_id = [ for node in data.proxmox_virtual_environment_node.hvc01 : node if node.node_name == "hv01"][0].id
# Validate talos_version variable
talos_version = [ for version in data.talos_image_factory_versions.this.talos_versions : version if version == var.talos_version][0]
2026-09-02 14:14:49 -04:00
cluster_endpoint = "https://${var.cluster_name}:6443"
2026-09-02 21:14:55 -04:00
machine_config_patches = { for guest in var.vm_guests: guest.name => [
templatefile("${path.root}/templates/talos_hostname_config.yml.tftpl", {
hostname = guest.name
}),
templatefile("${path.root}/templates/talos_link_config.yml.tftpl", {
ipv4_address = guest.ipv4_address
ipv4_subnet_mask = var.ipv4_subnet_mask
ipv4_gateway = var.ipv4_gateway
}),
templatefile("${path.root}/templates/talos_resolver_config.yml.tftpl", {
ipv4_nameservers = var.ipv4_nameservers
ipv6_nameservers = var.ipv6_nameservers
search_domains = var.search_domains
}),
templatefile("${path.root}/templates/talos_timesync_config.yml.tftpl", {
ipv4_ntp_servers = var.ipv4_ntp_servers
ipv6_ntp_servers = var.ipv6_ntp_servers
}),
file("${path.root}/files/talos_kubespan_config.yml")
] if contains(["controlplane", "worker"], guest.role)}
2026-09-01 17:31:47 -04:00
}