1
0
Fork 0
This repository has been archived on 2025-08-24. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
mareshq-hcloud-images/images/talos-v1.10.3.pkr.hcl
2025-06-13 20:53:00 +02:00

52 lines
1.2 KiB
HCL

# hcloud.pkr.hcl
packer {
required_plugins {
hcloud = {
source = "github.com/hetznercloud/hcloud"
version = ">= 1.6.0, < 2.0.0"
}
}
}
locals {
image = "https://factory.talos.dev/image/376567988ad370138ad8b2698212367b8edcb69b5fd68c80be1f2ec7d603b4ba/${local.talos_version}/hcloud-${var.arch}.raw.xz"
talos_version = "v1.10.3"
}
source "hcloud" "talos" {
token = var.hcloud_token
rescue = "linux64"
image = "debian-11"
location = "fsn1"
ssh_username = "root"
snapshot_labels = {
type = "infra",
os = "talos",
version = "${local.talos_version}",
}
}
build {
source "hcloud.talos" {
name = "x86"
server_type = "cx22"
snapshot_name = "talos-${local.talos_version}-amd64-${formatdate("YYYY-MM-DD", timestamp())}"
}
source "hcloud.talos" {
name = "arm"
server_type = "cax11"
snapshot_name = "talos-${local.talos_version}-arm64-${formatdate("YYYY-MM-DD", timestamp())}"
}
provisioner "shell" {
inline = [
"apt-get install -y wget",
"wget -O /tmp/talos.raw.xz ${local.image}",
"xz -d -c /tmp/talos.raw.xz | dd of=/dev/sda && sync",
]
}
}