wip
This commit is contained in:
parent
5def74736b
commit
26be097fda
13 changed files with 356 additions and 184 deletions
25
pve01.wheatley.in/k8s-wheatley/modules/talos-image/main.tf
Normal file
25
pve01.wheatley.in/k8s-wheatley/modules/talos-image/main.tf
Normal 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
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
customization:
|
||||
systemExtensions:
|
||||
officialExtensions:
|
||||
- siderolabs/qemu-guest-agent
|
||||
|
|
@ -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"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue