From a13ce9ce64d0d1853feb3c801061957e3791137c Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 14 Jan 2024 17:18:58 +0100 Subject: [PATCH] fix: fix defaults for pve 8.x --- README.md | 4 ++-- rocky-9/server.auto.pkrvars.hcl | 3 +-- rocky-9/server.pkr.hcl | 16 ++++++++-------- rocky-9/variables.pkr.hcl | 16 ++++++++-------- 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index b5fb0f0..aa4e92b 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Download the **latest** release. ### Step 2 - Download the Guest Operating Systems ISOs -1. Download the required guest operating system ISO images (e.g. `Rocky-9.0-x86_64-minimal.iso`). +1. Download the required guest operating system ISO images (e.g. `Rocky-9.3-x86_64-minimal.iso`). 2. Obtain the checksum type (e.g. `sha256`, `md5`, etc.) and checksum value for each guest operating system `.iso` image. This will be used in the build input variables. 3. Upload the guest operating system `.iso` images to your Proxmox server. @@ -38,7 +38,7 @@ If required, modify the configuration and scripts files. ## Build -Initialize packer and start a build. +Initialize packer and start a build. Packer creates a local HTTP server to provide the kickstart file for the VM. For this to work, the Proxmox server must be able to reach the host IP of the Packer host. > **Info:** Using the force flag will automatically remove existing _templates_ with a matching name or VMID. diff --git a/rocky-9/server.auto.pkrvars.hcl b/rocky-9/server.auto.pkrvars.hcl index e612a62..71278cd 100644 --- a/rocky-9/server.auto.pkrvars.hcl +++ b/rocky-9/server.auto.pkrvars.hcl @@ -3,12 +3,11 @@ vm_id = 910 vm_guest_os_keyboard = "de(nodeadkeys)" vm_guest_os_timezone = "Europe/Berlin" vm_cloud_init = true -vm_cloud_init_storage_pool = "storage01" vm_qemu_agent = true // Proxmox Settings proxmox_iso_pool = "local:iso" -proxmox_iso_file = "Rocky-9.0-x86_64-minimal.iso" +proxmox_iso_file = "Rocky-9.3-x86_64-minimal.iso" proxmox_template_description = "Rocky Linux 9 Template" proxmox_template_name = "rocky-9-cloud" diff --git a/rocky-9/server.pkr.hcl b/rocky-9/server.pkr.hcl index 073387a..ce28498 100644 --- a/rocky-9/server.pkr.hcl +++ b/rocky-9/server.pkr.hcl @@ -2,7 +2,7 @@ packer { required_version = ">= 1.8.3" required_plugins { proxmox = { - version = "1.1.2" + version = "1.1.6" source = "github.com/hashicorp/proxmox" } } @@ -49,18 +49,18 @@ source "proxmox-iso" "rocky-linux-9" { } disks { - disk_size = "${var.vm_disk_size}" - format = "${var.proxmox_storage_format}" - storage_pool = "${var.proxmox_storage_pool}" - storage_pool_type = "${var.proxmox_storage_pool_type}" - type = "scsi" + disk_size = "${var.vm_disk_size}" + format = "${var.proxmox_storage_format}" + storage_pool = "${var.proxmox_storage_pool}" + type = "scsi" } scsi_controller = "virtio-scsi-pci" // Removable Media Settings - iso_file = "${var.proxmox_iso_pool}/${var.proxmox_iso_file}" - http_content = "${local.data_source_content}" + iso_file = "${var.proxmox_iso_pool}/${var.proxmox_iso_file}" + http_content = "${local.data_source_content}" + http_interface = "${var.http_interface}" // Boot and Provisioning Settings boot_wait = "10s" diff --git a/rocky-9/variables.pkr.hcl b/rocky-9/variables.pkr.hcl index 6342316..0de44d6 100644 --- a/rocky-9/variables.pkr.hcl +++ b/rocky-9/variables.pkr.hcl @@ -48,12 +48,6 @@ variable "proxmox_storage_pool" { default = "local-lvm" } -variable "proxmox_storage_pool_type" { - type = string - description = "The type of the storage pool." - default = "lvm-thin" -} - variable "proxmox_template_description" { type = string description = "Description of the template, visible in the Proxmox interface." @@ -110,7 +104,7 @@ variable "vm_cpu_cores" { variable "vm_cpu_type" { type = string description = "The CPU type to emulate." - default = "host" + default = "x86-64-v2-AES" } variable "vm_mem_size" { @@ -140,7 +134,7 @@ variable "vm_disk_thin_provisioned" { variable "vm_network_adapter_model" { type = string description = "Model of the virtual network adapter." - default = "e1000" + default = "virtio" } variable "vm_network_adapter_bridge" { @@ -173,6 +167,12 @@ variable "vm_qemu_agent" { default = false } +variable "http_interface" { + type = string + description = "Name of the network interface that Packer gets HTTPIP from." + default = "" +} + // Communicator Settings and Credentials variable "build_password" { type = string