[ubuntu24] feat: restructured packer file and added comments

This commit is contained in:
Simon Cornet 2024-07-15 15:42:52 +02:00
parent b373afbd3a
commit 8fa92611c4

View File

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