forked from kubebn/talos-proxmox-kaas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
proxmox.pkr.hcl
77 lines (67 loc) · 1.78 KB
/
proxmox.pkr.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
packer {
required_plugins {
proxmox = {
version = ">= 1.0.1"
source = "github.com/hashicorp/proxmox"
}
}
}
source "proxmox" "talos" {
proxmox_url = var.proxmox_url
username = var.proxmox_username
token = var.proxmox_token
node = var.proxmox_nodename
insecure_skip_tls_verify = true
iso_file = "local:iso/archlinux-2023.04.01-x86_64.iso"
unmount_iso = true
scsi_controller = "virtio-scsi-pci"
network_adapters {
bridge = "vmbr0"
model = "virtio"
}
disks {
type = "scsi"
storage_pool = var.proxmox_storage
storage_pool_type = var.proxmox_storage_type
format = "raw"
disk_size = "1500M"
cache_mode = "writethrough"
}
memory = 2048
ssh_username = "root"
ssh_password = "packer"
ssh_timeout = "15m"
qemu_agent = true
template_name = "talos"
template_description = "Talos system disk"
boot_wait = "25s"
boot_command = [
"<enter><wait1m>",
"passwd<enter><wait>packer<enter><wait>packer<enter>",
"ip address add ${var.static_ip} broadcast + dev ens18<enter><wait>",
"ip route add 0.0.0.0/0 via ${var.gateway} dev ens18<enter><wait>"
]
}
build {
name = "release"
sources = ["source.proxmox.talos"]
provisioner "shell" {
inline = [
"curl -L ${local.image} -o /tmp/talos.raw.xz",
"xz -d -c /tmp/talos.raw.xz | dd of=/dev/sda && sync",
]
}
}
build {
name = "develop"
sources = ["source.proxmox.talos"]
provisioner "file" {
source = "../../../talos/_out/nocloud-amd64.raw.xz"
destination = "/tmp/talos.raw.xz"
}
provisioner "shell" {
inline = [
"xz -d -c /tmp/talos.raw.xz | dd of=/dev/sda && sync",
]
}
}