diff --git a/ubuntu24/packer.pkr.hcl b/ubuntu24/packer.pkr.hcl index 142a0b1..f970187 100644 --- a/ubuntu24/packer.pkr.hcl +++ b/ubuntu24/packer.pkr.hcl @@ -1,12 +1,15 @@ +# packer packer { required_plugins { proxmox = { - version = ">=1.1.7" + version = ">=1.1.8" source = "github.com/hashicorp/proxmox" } } } + +# variables variable "proxmox_iso_pool" { type = string default = "" @@ -77,23 +80,35 @@ variable "version" { default = "" } + +# builder source "proxmox-iso" "template" { + + # boot boot_command = ["c", "linux /casper/vmlinuz -- autoinstall ds='nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/'", "", "initrd /casper/initrd", "", "boot"] boot_wait = "10s" - cores = "2" + + # specs + cores = "2" + memory = "2048" + + # storage disks { disk_size = "20G" format = "${var.proxmox_storage_format}" storage_pool = "${var.proxmox_storage_pool}" type = "virtio" } - http_directory = "ubuntu24/http" - insecure_skip_tls_verify = true - iso_file = "${var.proxmox_iso_pool}/${var.ubuntu_image}" - memory = "2048" + + # networking network_adapters { bridge = "vmbr0" } + + # misc + http_directory = "ubuntu24/http" + insecure_skip_tls_verify = true + iso_file = "${var.proxmox_iso_pool}/${var.ubuntu_image}" node = "${var.proxmox_node}" vm_id = "999" tags = "mgmt"