Files
Hrankin, Aleksandr (contracted) f243f440c3 init
2026-02-19 11:34:13 +00:00

92 lines
1.9 KiB
HCL

packer {
required_plugins {
proxmox = {
source = "github.com/hashicorp/proxmox"
version = ">= 1.2.3"
}
}
}
source "proxmox-iso" "debian13" {
proxmox_url = "https://192.168.0.126:8006/api2/json"
username = "root@pam!packer"
token = "7f3cd12a-c98e-4aec-abca-8d7fd1005fd7"
insecure_skip_tls_verify = true
node = "proxmox-main-kyiv-01"
vm_id = 300
vm_name = "dev-kyiv01-template-packer-main-01"
template_name = "dev-kyiv01-template-packer-main-01"
tags = "debian-13"
os = "l26"
bios = "seabios"
machine = "q35"
cpu_type = "qemu64"
cores = 1
sockets = 1
memory = 1024
qemu_agent = true
scsi_controller = "virtio-scsi-single"
network_adapters {
model = "virtio"
bridge = "vmbr0"
firewall = false
mac_address = "repeatable"
}
disks {
type = "scsi"
storage_pool = "local-lvm"
disk_size = "4G"
io_thread = true
discard = true
ssd = true
}
boot_iso {
type = "scsi"
iso_file = "local:iso/debian-13.2.0-amd64-netinst.iso"
unmount = true
}
# ===== HTTP preseed =====
http_directory = "${path.root}/http"
http_bind_address = "192.168.0.200"
http_port_min = 8870
http_port_max = 8870
boot_wait = "10s"
boot_key_interval = "25ms"
boot_command = [
"<esc><wait>",
"auto auto=true priority=critical ",
"preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
"debian-installer=en_US ",
"fb=false ",
"<enter>"
]
# ===== SSH =====
ssh_username = "packer"
ssh_password = "14881488"
ssh_timeout = "35m"
cloud_init = false
}
build {
sources = ["source.proxmox-iso.debian13"]
provisioner "shell" {
execute_command = "sudo -S -E bash '{{ .Path }}'"
scripts = [
"scripts/10-base.sh",
"scripts/90-cleanup.sh"
]
}
}