Storing version in a var

This commit is contained in:
vandomej 2025-09-27 23:22:22 -07:00
parent 137c6f5e84
commit cdb19b2aaa
2 changed files with 11 additions and 4 deletions

12
main.tf
View file

@ -27,6 +27,12 @@ variable "vcpu_count" {
default = 2
}
variable "talos_version" {
description = "The version of Talos to use"
type = string
default = "v1.11.1"
}
# Configure providers
provider "talos" {}
@ -39,7 +45,7 @@ data "talos_machine_configuration" "this" {
cluster_endpoint = "https://10.5.0.2:6443"
machine_type = "controlplane"
machine_secrets = talos_machine_secrets.this.machine_secrets
talos_version = "v1.11.1"
talos_version = var.talos_version
}
data "talos_client_configuration" "this" {
@ -59,8 +65,8 @@ resource "null_resource" "talos_cluster" {
provisioner "local-exec" {
command = <<EOT
mkdir -p _out/
curl -L -o _out/vmlinuz-arm64 https://github.com/siderolabs/talos/releases/download/${self.triggers.version}/vmlinuz-arm64
curl -L -o _out/initramfs-arm64.xz https://github.com/siderolabs/talos/releases/download/${self.triggers.version}/initramfs-arm64.xz
curl -L -o _out/vmlinuz-arm64 https://github.com/siderolabs/talos/releases/download/${var.talos_version}/vmlinuz-arm64
curl -L -o _out/initramfs-arm64.xz https://github.com/siderolabs/talos/releases/download/${var.talos_version}/initramfs-arm64.xz
EOT
}

View file

@ -2,3 +2,4 @@
cluster_name = "evolved-npcs-cluster"
memory_mb = 2048
vcpu_count = 2
talos_version = "v1.11.1"