This commit is contained in:
Peter 2025-10-26 11:42:08 +01:00
parent 5def74736b
commit 26be097fda
Signed by: Peter
SSH key fingerprint: SHA256:B5tYaxBExaDm74r1px9iVeZ6F/ZDiyiy9SbBqfZYrvg
13 changed files with 356 additions and 184 deletions

View file

@ -0,0 +1,25 @@
data "http" "schematic" {
url = "https://factory.talos.dev/schematics"
method = "POST"
request_body = file("${path.module}/schematic.yaml")
request_headers = {
"Content-Type" = "application/x-yaml"
}
}
locals {
schematic_id = jsondecode(data.http.schematic.response_body)["id"]
iso_url = "${"https://factory.talos.dev/image"}/${local.schematic_id}/${var.talos_version}/nocloud-amd64.iso"
iso_file = "${var.iso_path}/talos-${local.schematic_id}-${var.talos_version}-nocloud-amd64.iso"
}
resource "null_resource" "download_iso" {
provisioner "local-exec" {
command = <<-EOT
mkdir -p ${var.iso_path}
if [ ! -f "${local.iso_file}" ]; then
curl -L -o "${local.iso_file}" "${local.iso_url}"
fi
EOT
}
}

View file

@ -0,0 +1,4 @@
customization:
systemExtensions:
officialExtensions:
- siderolabs/qemu-guest-agent

View file

@ -0,0 +1,10 @@
variable "talos_version" {
description = "Talos version to download"
type = string
}
variable "iso_path" {
description = "Path to store downloaded Talos ISO images"
type = string
default = "/var/lib/vz/template/iso"
}