feat: Automatically fetch Talos install image
This commit is contained in:
parent
5def74736b
commit
7d4baad8ff
7 changed files with 110 additions and 38 deletions
34
pve01.wheatley.in/k8s-wheatley/modules/talos-image/main.tf
Normal file
34
pve01.wheatley.in/k8s-wheatley/modules/talos-image/main.tf
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
terraform {
|
||||
required_providers {
|
||||
proxmox = {
|
||||
source = "bpg/proxmox"
|
||||
version = "0.85.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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}/v${var.talos_version}/nocloud-amd64-secureboot.iso"
|
||||
iso_file = "talos-${var.talos_version}-nocloud-amd64-secureboot.iso"
|
||||
}
|
||||
|
||||
resource "proxmox_virtual_environment_download_file" "talos-image" {
|
||||
node_name = "pve01"
|
||||
content_type = "iso"
|
||||
datastore_id = "local"
|
||||
overwrite = true
|
||||
|
||||
url = local.iso_url
|
||||
file_name = local.iso_file
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue