refactor(talos): make talos_machine_config_version an optional parameter

This commit is contained in:
Vegard Hagen
2025-03-23 13:45:42 +01:00
parent df275c36b3
commit cab677855f
3 changed files with 15 additions and 14 deletions
-1
View File
@@ -26,7 +26,6 @@ module "talos" {
# Ref: https://www.talos.dev/v1.9/talos-guides/network/vip/#requirements
# Note This is Kubernetes API endpoint. Different from all mentions of Talos endpoints.
endpoint = "192.168.1.102"
# Omit this if devices are not connected on layer 2
vip = "192.168.1.99"
gateway = "192.168.1.1"
# The version of talos features to use in generated machine configuration. Generally the same as image version.
+3 -1
View File
@@ -17,7 +17,9 @@ data "talos_machine_configuration" "this" {
# This is the Kubernetes API Server endpoint.
# ref - https://www.talos.dev/v1.9/introduction/prodnotes/#decide-the-kubernetes-endpoint
cluster_endpoint = "https://${var.cluster.endpoint}:6443"
talos_version = var.cluster.talos_machine_config_version
# @formatter:off
talos_version = var.cluster.talos_machine_config_version != null ? var.cluster.talos_machine_config_version : (each.value.update == true ? var.image.update_version : var.image.version)
# @formatter:on
machine_type = each.value.machine_type
machine_secrets = talos_machine_secrets.this.machine_secrets
config_patches = [
+1 -1
View File
@@ -20,7 +20,7 @@ variable "cluster" {
vip = optional(string)
gateway = string
subnet_mask = optional(string, "24")
talos_machine_config_version = string
talos_machine_config_version = optional(string)
proxmox_cluster = string
kubernetes_version = string
base_domain = string