From cf8f643f0a9bbb7038af6284efa14af1d9bac97b Mon Sep 17 00:00:00 2001 From: AJ Schroeder <6432150+ajschroeder@users.noreply.github.com> Date: Tue, 10 Jun 2025 15:19:44 -0500 Subject: [PATCH] fix: update boot_iso section, fix var names, and pin proxmox plugin version --- .../linux/almalinux/8/linux-almalinux.pkr.hcl | 21 +++++++++++------ builds/linux/almalinux/8/variables.pkr.hcl | 10 ++++++-- .../linux/almalinux/9/linux-almalinux.pkr.hcl | 21 +++++++++++------ builds/linux/almalinux/9/variables.pkr.hcl | 10 ++++++-- .../10-stream/linux-centos-stream.pkr.hcl | 23 ++++++++++++------- .../linux/centos/10-stream/variables.pkr.hcl | 8 ++++++- .../9-stream/linux-centos-stream.pkr.hcl | 23 ++++++++++++------- .../linux/centos/9-stream/variables.pkr.hcl | 10 ++++++-- builds/linux/debian/11/linux-debian.pkr.hcl | 23 ++++++++++++------- builds/linux/debian/11/variables.pkr.hcl | 10 ++++++-- builds/linux/debian/12/linux-debian.pkr.hcl | 23 ++++++++++++------- builds/linux/debian/12/variables.pkr.hcl | 10 ++++++-- .../leap-15-5/linux-opensuse-leap.pkr.hcl | 21 +++++++++++------ .../opensuse/leap-15-5/variables.pkr.hcl | 10 ++++++-- .../leap-15-6/linux-opensuse-leap.pkr.hcl | 21 +++++++++++------ .../opensuse/leap-15-6/variables.pkr.hcl | 10 ++++++-- builds/linux/oracle/8/linux-oracle.pkr.hcl | 21 +++++++++++------ builds/linux/oracle/8/variables.pkr.hcl | 10 ++++++-- builds/linux/oracle/9/linux-oracle.pkr.hcl | 21 +++++++++++------ builds/linux/oracle/9/variables.pkr.hcl | 10 ++++++-- builds/linux/rocky/8/linux-rocky.pkr.hcl | 23 ++++++++++++------- builds/linux/rocky/8/variables.pkr.hcl | 10 ++++++-- builds/linux/rocky/9/linux-rocky.pkr.hcl | 21 +++++++++++------ builds/linux/rocky/9/variables.pkr.hcl | 10 ++++++-- .../ubuntu/20-04-lts/linux-ubuntu.pkr.hcl | 21 +++++++++++------ .../linux/ubuntu/20-04-lts/variables.pkr.hcl | 10 ++++++-- .../ubuntu/22-04-lts/linux-ubuntu.pkr.hcl | 21 +++++++++++------ .../linux/ubuntu/22-04-lts/variables.pkr.hcl | 10 ++++++-- .../ubuntu/24-04-lts/linux-ubuntu.pkr.hcl | 21 +++++++++++------ .../linux/ubuntu/24-04-lts/variables.pkr.hcl | 10 ++++++-- 30 files changed, 334 insertions(+), 139 deletions(-) diff --git a/builds/linux/almalinux/8/linux-almalinux.pkr.hcl b/builds/linux/almalinux/8/linux-almalinux.pkr.hcl index 48fdca2..47ea347 100644 --- a/builds/linux/almalinux/8/linux-almalinux.pkr.hcl +++ b/builds/linux/almalinux/8/linux-almalinux.pkr.hcl @@ -7,7 +7,7 @@ // The Packer configuration. packer { - required_version = ">= 1.11.0" + required_version = ">= 1.12.0" required_plugins { ansible = { source = "github.com/hashicorp/ansible" @@ -18,7 +18,7 @@ packer { source = "github.com/ethanmdavidson/git" } proxmox = { - version = ">= 1.1.8" + version = "= 1.2.1" source = "github.com/hashicorp/proxmox" } } @@ -36,7 +36,7 @@ locals { bios_boot_command = [ // This sends the "up arrow" key, typically used to navigate through boot menu options. "", - // This sends the "tab" key. In the BIOS bootloader, this is how you customize the boot options. + // This sends the "tab" key. In the BIOS bootloader, this is how you customize the boot options. "", "inst.text biosdevname=0 net.ifnames=0 inst.gpt", " ${local.data_source_command}", @@ -103,7 +103,7 @@ locals { // Defines the builder configuration blocks. source "proxmox-iso" "linux-almalinux" { - + // Proxmox Connection Settings and Credentials proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json" username = "${var.proxmox_api_token_id}" @@ -122,12 +122,14 @@ source "proxmox-iso" "linux-almalinux" { memory = "${var.vm_mem_size}" os = "${var.vm_os_type}" scsi_controller = "${var.vm_disk_controller_type}" + disks { disk_size = "${var.vm_disk_size}" type = "${var.vm_disk_type}" storage_pool = "${var.vm_storage_pool}" format = "${var.vm_disk_format}" } + dynamic "efi_config" { for_each = var.vm_bios == "ovmf" ? [1] : [] content { @@ -136,13 +138,11 @@ source "proxmox-iso" "linux-almalinux" { pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null } } - unmount_iso = true + ssh_username = "${var.build_username}" ssh_password = "${var.build_password}" ssh_timeout = "${var.timeout}" ssh_port = "22" - iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" - iso_checksum = "${var.iso_checksum}" qemu_agent = true network_adapters { @@ -155,6 +155,7 @@ source "proxmox-iso" "linux-almalinux" { http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null // Boot and Provisioning Settings + http_interface = var.common_data_source == "http" ? var.common_http_interface : null http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null @@ -162,6 +163,12 @@ source "proxmox-iso" "linux-almalinux" { boot_wait = var.vm_boot_wait boot_command = local.boot_command + boot_iso { + iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" + unmount = true + iso_checksum = "${var.iso_checksum}" + } + dynamic "additional_iso_files" { for_each = var.common_data_source == "disk" ? [1] : [] content { diff --git a/builds/linux/almalinux/8/variables.pkr.hcl b/builds/linux/almalinux/8/variables.pkr.hcl index 25b08c4..5d8f009 100644 --- a/builds/linux/almalinux/8/variables.pkr.hcl +++ b/builds/linux/almalinux/8/variables.pkr.hcl @@ -215,6 +215,12 @@ variable "common_http_bind_address" { default = null } +variable "common_http_interface" { + type = string + description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface." + default = null +} + variable "common_http_port_min" { type = number description = "The start of the HTTP port range." @@ -250,7 +256,7 @@ variable "common_shutdown_timeout" { variable "build_username" { type = string description = "The username to login to the guest operating system. (e.g. 'ubuntu')" -# sensitive = true +# sensitive = true } variable "build_password" { @@ -304,4 +310,4 @@ variable "additional_packages" { type = list(string) description = "Additional packages to install." default = [] -} \ No newline at end of file +} diff --git a/builds/linux/almalinux/9/linux-almalinux.pkr.hcl b/builds/linux/almalinux/9/linux-almalinux.pkr.hcl index 282051f..3326ee2 100644 --- a/builds/linux/almalinux/9/linux-almalinux.pkr.hcl +++ b/builds/linux/almalinux/9/linux-almalinux.pkr.hcl @@ -7,7 +7,7 @@ // The Packer configuration. packer { - required_version = ">= 1.11.0" + required_version = ">= 1.12.0" required_plugins { ansible = { source = "github.com/hashicorp/ansible" @@ -18,7 +18,7 @@ packer { source = "github.com/ethanmdavidson/git" } proxmox = { - version = ">= 1.1.8" + version = ">= 1.2.1" source = "github.com/hashicorp/proxmox" } } @@ -36,7 +36,7 @@ locals { bios_boot_command = [ // This sends the "up arrow" key, typically used to navigate through boot menu options. "", - // This sends the "tab" key. In the BIOS bootloader, this is how you customize the boot options. + // This sends the "tab" key. In the BIOS bootloader, this is how you customize the boot options. "", "inst.text biosdevname=0 net.ifnames=0 inst.gpt", " ${local.data_source_command}", @@ -103,7 +103,7 @@ locals { // Defines the builder configuration blocks. source "proxmox-iso" "linux-almalinux" { - + // Proxmox Connection Settings and Credentials proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json" username = "${var.proxmox_api_token_id}" @@ -122,12 +122,14 @@ source "proxmox-iso" "linux-almalinux" { memory = "${var.vm_mem_size}" os = "${var.vm_os_type}" scsi_controller = "${var.vm_disk_controller_type}" + disks { disk_size = "${var.vm_disk_size}" type = "${var.vm_disk_type}" storage_pool = "${var.vm_storage_pool}" format = "${var.vm_disk_format}" } + dynamic "efi_config" { for_each = var.vm_bios == "ovmf" ? [1] : [] content { @@ -136,13 +138,11 @@ source "proxmox-iso" "linux-almalinux" { pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null } } - unmount_iso = true + ssh_username = "${var.build_username}" ssh_password = "${var.build_password}" ssh_timeout = "${var.timeout}" ssh_port = "22" - iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" - iso_checksum = "${var.iso_checksum}" qemu_agent = true network_adapters { @@ -155,6 +155,7 @@ source "proxmox-iso" "linux-almalinux" { http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null // Boot and Provisioning Settings + http_interface = var.common_data_source == "http" ? var.common_http_interface : null http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null @@ -162,6 +163,12 @@ source "proxmox-iso" "linux-almalinux" { boot_wait = var.vm_boot_wait boot_command = local.boot_command + boot_iso { + iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" + unmount = true + iso_checksum = "${var.iso_checksum}" + } + dynamic "additional_iso_files" { for_each = var.common_data_source == "disk" ? [1] : [] content { diff --git a/builds/linux/almalinux/9/variables.pkr.hcl b/builds/linux/almalinux/9/variables.pkr.hcl index e255b76..9c052fe 100644 --- a/builds/linux/almalinux/9/variables.pkr.hcl +++ b/builds/linux/almalinux/9/variables.pkr.hcl @@ -215,6 +215,12 @@ variable "common_http_bind_address" { default = null } +variable "common_http_interface" { + type = string + description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface." + default = null +} + variable "common_http_port_min" { type = number description = "The start of the HTTP port range." @@ -250,7 +256,7 @@ variable "common_shutdown_timeout" { variable "build_username" { type = string description = "The username to login to the guest operating system. (e.g. 'ubuntu')" -# sensitive = true +# sensitive = true } variable "build_password" { @@ -304,4 +310,4 @@ variable "additional_packages" { type = list(string) description = "Additional packages to install." default = [] -} \ No newline at end of file +} diff --git a/builds/linux/centos/10-stream/linux-centos-stream.pkr.hcl b/builds/linux/centos/10-stream/linux-centos-stream.pkr.hcl index e77c0f6..0f8e444 100644 --- a/builds/linux/centos/10-stream/linux-centos-stream.pkr.hcl +++ b/builds/linux/centos/10-stream/linux-centos-stream.pkr.hcl @@ -7,18 +7,18 @@ // The Packer configuration. packer { - required_version = ">= 1.9.1" + required_version = ">= 1.12.0" required_plugins { ansible = { source = "github.com/hashicorp/ansible" version = "~> 1" } git = { - version = ">= 0.4.2" + version = ">= 0.6.2" source = "github.com/ethanmdavidson/git" } proxmox = { - version = ">= 1.0.6" + version = "= 1.2.1" source = "github.com/hashicorp/proxmox" } } @@ -53,7 +53,7 @@ locals { "text ${local.data_source_command}", // This sends the "enter" key, waits, turns on the left control key, sends the "x" key, and then turns off the left control key. This is used to save the changes and exit the boot menu option's configuration, and then continue the boot process. "x" - ] + ] build_by = "Built by: HashiCorp Packer ${packer.version}" build_date = formatdate("DD-MM-YYYY hh:mm ZZZ", "${timestamp()}" ) @@ -102,7 +102,7 @@ locals { // Defines the builder configuration blocks. source "proxmox-iso" "linux-centos-stream" { - + // Proxmox Connection Settings and Credentials proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json" username = "${var.proxmox_api_token_id}" @@ -121,12 +121,14 @@ source "proxmox-iso" "linux-centos-stream" { memory = "${var.vm_mem_size}" os = "${var.vm_os_type}" scsi_controller = "${var.vm_disk_controller_type}" + disks { disk_size = "${var.vm_disk_size}" type = "${var.vm_disk_type}" storage_pool = "${var.vm_storage_pool}" format = "${var.vm_disk_format}" } + dynamic "efi_config" { for_each = var.vm_bios == "ovmf" ? [1] : [] content { @@ -135,13 +137,11 @@ source "proxmox-iso" "linux-centos-stream" { pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null } } - unmount_iso = true + ssh_username = "${var.build_username}" ssh_password = "${var.build_password}" ssh_timeout = "${var.timeout}" ssh_port = "22" - iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" - iso_checksum = "${var.iso_checksum}" qemu_agent = true network_adapters { @@ -154,6 +154,7 @@ source "proxmox-iso" "linux-centos-stream" { http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null // Boot and Provisioning Settings + http_interface = var.common_data_source == "http" ? var.common_http_interface : null http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null @@ -161,6 +162,12 @@ source "proxmox-iso" "linux-centos-stream" { boot_wait = var.vm_boot_wait boot_command = local.boot_command + boot_iso { + iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" + unmount = true + iso_checksum = "${var.iso_checksum}" + } + dynamic "additional_iso_files" { for_each = var.common_data_source == "disk" ? [1] : [] content { diff --git a/builds/linux/centos/10-stream/variables.pkr.hcl b/builds/linux/centos/10-stream/variables.pkr.hcl index 5c4eedc..645c37f 100644 --- a/builds/linux/centos/10-stream/variables.pkr.hcl +++ b/builds/linux/centos/10-stream/variables.pkr.hcl @@ -215,6 +215,12 @@ variable "common_http_bind_address" { default = null } +variable "common_http_interface" { + type = string + description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface." + default = null +} + variable "common_http_port_min" { type = number description = "The start of the HTTP port range." @@ -250,7 +256,7 @@ variable "common_shutdown_timeout" { variable "build_username" { type = string description = "The username to login to the guest operating system. (e.g. 'ubuntu')" -# sensitive = true +# sensitive = true } variable "build_password" { diff --git a/builds/linux/centos/9-stream/linux-centos-stream.pkr.hcl b/builds/linux/centos/9-stream/linux-centos-stream.pkr.hcl index 008fed4..7a00a8c 100644 --- a/builds/linux/centos/9-stream/linux-centos-stream.pkr.hcl +++ b/builds/linux/centos/9-stream/linux-centos-stream.pkr.hcl @@ -7,18 +7,18 @@ // The Packer configuration. packer { - required_version = ">= 1.9.1" + required_version = ">= 1.12.0" required_plugins { ansible = { source = "github.com/hashicorp/ansible" version = "~> 1" } git = { - version = ">= 0.4.2" + version = ">= 0.6.2" source = "github.com/ethanmdavidson/git" } proxmox = { - version = ">= 1.0.6" + version = "= 1.2.1" source = "github.com/hashicorp/proxmox" } } @@ -53,7 +53,7 @@ locals { "text ${local.data_source_command}", // This sends the "enter" key, waits, turns on the left control key, sends the "x" key, and then turns off the left control key. This is used to save the changes and exit the boot menu option's configuration, and then continue the boot process. "x" - ] + ] build_by = "Built by: HashiCorp Packer ${packer.version}" build_date = formatdate("DD-MM-YYYY hh:mm ZZZ", "${timestamp()}" ) @@ -102,7 +102,7 @@ locals { // Defines the builder configuration blocks. source "proxmox-iso" "linux-centos-stream" { - + // Proxmox Connection Settings and Credentials proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json" username = "${var.proxmox_api_token_id}" @@ -121,12 +121,14 @@ source "proxmox-iso" "linux-centos-stream" { memory = "${var.vm_mem_size}" os = "${var.vm_os_type}" scsi_controller = "${var.vm_disk_controller_type}" + disks { disk_size = "${var.vm_disk_size}" type = "${var.vm_disk_type}" storage_pool = "${var.vm_storage_pool}" format = "${var.vm_disk_format}" } + dynamic "efi_config" { for_each = var.vm_bios == "ovmf" ? [1] : [] content { @@ -135,13 +137,11 @@ source "proxmox-iso" "linux-centos-stream" { pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null } } - unmount_iso = true + ssh_username = "${var.build_username}" ssh_password = "${var.build_password}" ssh_timeout = "${var.timeout}" ssh_port = "22" - iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" - iso_checksum = "${var.iso_checksum}" qemu_agent = true network_adapters { @@ -154,6 +154,7 @@ source "proxmox-iso" "linux-centos-stream" { http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null // Boot and Provisioning Settings + http_interface = var.common_data_source == "http" ? var.common_http_interface : null http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null @@ -161,6 +162,12 @@ source "proxmox-iso" "linux-centos-stream" { boot_wait = var.vm_boot_wait boot_command = local.boot_command + boot_iso { + iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" + unmount = true + iso_checksum = "${var.iso_checksum}" + } + dynamic "additional_iso_files" { for_each = var.common_data_source == "disk" ? [1] : [] content { diff --git a/builds/linux/centos/9-stream/variables.pkr.hcl b/builds/linux/centos/9-stream/variables.pkr.hcl index 021fd86..fd174d3 100644 --- a/builds/linux/centos/9-stream/variables.pkr.hcl +++ b/builds/linux/centos/9-stream/variables.pkr.hcl @@ -215,6 +215,12 @@ variable "common_http_bind_address" { default = null } +variable "common_http_interface" { + type = string + description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface." + default = null +} + variable "common_http_port_min" { type = number description = "The start of the HTTP port range." @@ -250,7 +256,7 @@ variable "common_shutdown_timeout" { variable "build_username" { type = string description = "The username to login to the guest operating system. (e.g. 'ubuntu')" -# sensitive = true +# sensitive = true } variable "build_password" { @@ -304,4 +310,4 @@ variable "additional_packages" { type = list(string) description = "Additional packages to install." default = [] -} \ No newline at end of file +} diff --git a/builds/linux/debian/11/linux-debian.pkr.hcl b/builds/linux/debian/11/linux-debian.pkr.hcl index a66b9c8..b08bbf2 100644 --- a/builds/linux/debian/11/linux-debian.pkr.hcl +++ b/builds/linux/debian/11/linux-debian.pkr.hcl @@ -7,18 +7,18 @@ // The Packer configuration. packer { - required_version = ">= 1.9.1" + required_version = ">= 1.12.0" required_plugins { ansible = { source = "github.com/hashicorp/ansible" version = "~> 1" } git = { - version = ">= 0.4.2" + version = ">= 0.6.2" source = "github.com/ethanmdavidson/git" } proxmox = { - version = ">= 1.0.6" + version = "= 1.2.1" source = "github.com/hashicorp/proxmox" } } @@ -32,7 +32,7 @@ data "git-repository" "cwd" {} // BLOCK: locals // Defines the local variables. -locals { +locals { bios_boot_command = [ "", @@ -125,7 +125,7 @@ locals { // Defines the builder configuration blocks. source "proxmox-iso" "debian" { - + // Proxmox Connection Settings and Credentials proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json" username = "${var.proxmox_api_token_id}" @@ -144,12 +144,14 @@ source "proxmox-iso" "debian" { memory = "${var.vm_mem_size}" os = "${var.vm_os_type}" scsi_controller = "${var.vm_disk_controller_type}" + disks { disk_size = "${var.vm_disk_size}" type = "${var.vm_disk_type}" storage_pool = "${var.vm_storage_pool}" format = "${var.vm_disk_format}" } + dynamic "efi_config" { for_each = var.vm_bios == "ovmf" ? [1] : [] content { @@ -158,13 +160,11 @@ source "proxmox-iso" "debian" { pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null } } - unmount_iso = true + ssh_username = "${var.build_username}" ssh_password = "${var.build_password}" ssh_timeout = "${var.timeout}" ssh_port = "22" - iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" - iso_checksum = "${var.iso_checksum}" qemu_agent = true network_adapters { @@ -177,6 +177,7 @@ source "proxmox-iso" "debian" { http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null // Boot and Provisioning Settings + http_interface = var.common_data_source == "http" ? var.common_http_interface : null http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null @@ -184,6 +185,12 @@ source "proxmox-iso" "debian" { boot_wait = var.vm_boot_wait boot_command = local.boot_command + boot_iso { + iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" + unmount = true + iso_checksum = "${var.iso_checksum}" + } + dynamic "additional_iso_files" { for_each = var.common_data_source == "disk" ? [1] : [] content { diff --git a/builds/linux/debian/11/variables.pkr.hcl b/builds/linux/debian/11/variables.pkr.hcl index c80568e..2c06bdc 100644 --- a/builds/linux/debian/11/variables.pkr.hcl +++ b/builds/linux/debian/11/variables.pkr.hcl @@ -215,6 +215,12 @@ variable "common_http_bind_address" { default = null } +variable "common_http_interface" { + type = string + description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface." + default = null +} + variable "common_http_port_min" { type = number description = "The start of the HTTP port range." @@ -250,7 +256,7 @@ variable "common_shutdown_timeout" { variable "build_username" { type = string description = "The username to login to the guest operating system. (e.g. 'ubuntu')" -# sensitive = true +# sensitive = true } variable "build_password" { @@ -304,4 +310,4 @@ variable "additional_packages" { type = list(string) description = "Additional packages to install." default = [] -} \ No newline at end of file +} diff --git a/builds/linux/debian/12/linux-debian.pkr.hcl b/builds/linux/debian/12/linux-debian.pkr.hcl index 6c300af..8a8d444 100644 --- a/builds/linux/debian/12/linux-debian.pkr.hcl +++ b/builds/linux/debian/12/linux-debian.pkr.hcl @@ -7,18 +7,18 @@ // The Packer configuration. packer { - required_version = ">= 1.9.1" + required_version = ">= 1.12.0" required_plugins { ansible = { source = "github.com/hashicorp/ansible" version = "~> 1" } git = { - version = ">= 0.4.2" + version = ">= 0.6.2" source = "github.com/ethanmdavidson/git" } proxmox = { - version = ">= 1.0.6" + version = "= 1.2.1" source = "github.com/hashicorp/proxmox" } } @@ -32,7 +32,7 @@ data "git-repository" "cwd" {} // BLOCK: locals // Defines the local variables. -locals { +locals { bios_boot_command = [ "", @@ -124,7 +124,7 @@ locals { // Defines the builder configuration blocks. source "proxmox-iso" "debian" { - + // Proxmox Connection Settings and Credentials proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json" username = "${var.proxmox_api_token_id}" @@ -143,12 +143,14 @@ source "proxmox-iso" "debian" { memory = "${var.vm_mem_size}" os = "${var.vm_os_type}" scsi_controller = "${var.vm_disk_controller_type}" + disks { disk_size = "${var.vm_disk_size}" type = "${var.vm_disk_type}" storage_pool = "${var.vm_storage_pool}" format = "${var.vm_disk_format}" } + dynamic "efi_config" { for_each = var.vm_bios == "ovmf" ? [1] : [] content { @@ -157,13 +159,11 @@ source "proxmox-iso" "debian" { pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null } } - unmount_iso = true + ssh_username = "${var.build_username}" ssh_password = "${var.build_password}" ssh_timeout = "${var.timeout}" ssh_port = "22" - iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" - iso_checksum = "${var.iso_checksum}" qemu_agent = true network_adapters { @@ -176,6 +176,7 @@ source "proxmox-iso" "debian" { http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null // Boot and Provisioning Settings + http_interface = var.common_data_source == "http" ? var.common_http_interface : null http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null @@ -183,6 +184,12 @@ source "proxmox-iso" "debian" { boot_wait = var.vm_boot_wait boot_command = local.boot_command + boot_iso { + iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" + unmount = true + iso_checksum = "${var.iso_checksum}" + } + dynamic "additional_iso_files" { for_each = var.common_data_source == "disk" ? [1] : [] content { diff --git a/builds/linux/debian/12/variables.pkr.hcl b/builds/linux/debian/12/variables.pkr.hcl index ca3b54a..1c24e51 100644 --- a/builds/linux/debian/12/variables.pkr.hcl +++ b/builds/linux/debian/12/variables.pkr.hcl @@ -215,6 +215,12 @@ variable "common_http_bind_address" { default = null } +variable "common_http_interface" { + type = string + description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface." + default = null +} + variable "common_http_port_min" { type = number description = "The start of the HTTP port range." @@ -250,7 +256,7 @@ variable "common_shutdown_timeout" { variable "build_username" { type = string description = "The username to login to the guest operating system. (e.g. 'ubuntu')" -# sensitive = true +# sensitive = true } variable "build_password" { @@ -304,4 +310,4 @@ variable "additional_packages" { type = list(string) description = "Additional packages to install." default = [] -} \ No newline at end of file +} diff --git a/builds/linux/opensuse/leap-15-5/linux-opensuse-leap.pkr.hcl b/builds/linux/opensuse/leap-15-5/linux-opensuse-leap.pkr.hcl index 89f7582..da10146 100644 --- a/builds/linux/opensuse/leap-15-5/linux-opensuse-leap.pkr.hcl +++ b/builds/linux/opensuse/leap-15-5/linux-opensuse-leap.pkr.hcl @@ -7,18 +7,18 @@ // The Packer configuration. packer { - required_version = ">= 1.9.1" + required_version = ">= 1.12.0" required_plugins { ansible = { source = "github.com/hashicorp/ansible" version = "~> 1" } git = { - version = ">= 0.4.2" + version = ">= 0.6.2" source = "github.com/ethanmdavidson/git" } proxmox = { - version = ">= 1.1.6" + version = "= 1.2.1" source = "github.com/hashicorp/proxmox" } } @@ -107,7 +107,7 @@ locals { // Defines the builder configuration blocks. source "proxmox-iso" "linux-opensuse-leap" { - + // Proxmox Connection Settings and Credentials proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json" username = "${var.proxmox_api_token_id}" @@ -126,12 +126,14 @@ source "proxmox-iso" "linux-opensuse-leap" { memory = "${var.vm_mem_size}" os = "${var.vm_os_type}" scsi_controller = "${var.vm_disk_controller_type}" + disks { disk_size = "${var.vm_disk_size}" type = "${var.vm_disk_type}" storage_pool = "${var.vm_storage_pool}" format = "${var.vm_disk_format}" } + dynamic "efi_config" { for_each = var.vm_bios == "ovmf" ? [1] : [] content { @@ -140,13 +142,11 @@ source "proxmox-iso" "linux-opensuse-leap" { pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null } } - unmount_iso = true + ssh_username = "${var.build_username}" ssh_password = "${var.build_password}" ssh_timeout = "${var.timeout}" ssh_port = "22" - iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" - iso_checksum = "${var.iso_checksum}" qemu_agent = true network_adapters { @@ -159,6 +159,7 @@ source "proxmox-iso" "linux-opensuse-leap" { http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null // Boot and Provisioning Settings + http_interface = var.common_data_source == "http" ? var.common_http_interface : null http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null @@ -166,6 +167,12 @@ source "proxmox-iso" "linux-opensuse-leap" { boot_wait = var.vm_boot_wait boot_command = local.boot_command + boot_iso { + iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" + unmount = true + iso_checksum = "${var.iso_checksum}" + } + dynamic "additional_iso_files" { for_each = var.common_data_source == "disk" ? [1] : [] content { diff --git a/builds/linux/opensuse/leap-15-5/variables.pkr.hcl b/builds/linux/opensuse/leap-15-5/variables.pkr.hcl index b5451e1..44453e3 100644 --- a/builds/linux/opensuse/leap-15-5/variables.pkr.hcl +++ b/builds/linux/opensuse/leap-15-5/variables.pkr.hcl @@ -215,6 +215,12 @@ variable "common_http_bind_address" { default = null } +variable "common_http_interface" { + type = string + description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface." + default = null +} + variable "common_http_port_min" { type = number description = "The start of the HTTP port range." @@ -250,7 +256,7 @@ variable "common_shutdown_timeout" { variable "build_username" { type = string description = "The username to login to the guest operating system. (e.g. 'ubuntu')" -# sensitive = true +# sensitive = true } variable "build_password" { @@ -304,4 +310,4 @@ variable "additional_packages" { type = list(string) description = "Additional packages to install." default = [] -} \ No newline at end of file +} diff --git a/builds/linux/opensuse/leap-15-6/linux-opensuse-leap.pkr.hcl b/builds/linux/opensuse/leap-15-6/linux-opensuse-leap.pkr.hcl index c09a13a..d25ef6f 100644 --- a/builds/linux/opensuse/leap-15-6/linux-opensuse-leap.pkr.hcl +++ b/builds/linux/opensuse/leap-15-6/linux-opensuse-leap.pkr.hcl @@ -7,18 +7,18 @@ // The Packer configuration. packer { - required_version = ">= 1.9.1" + required_version = ">= 1.12.0" required_plugins { ansible = { source = "github.com/hashicorp/ansible" version = "~> 1" } git = { - version = ">= 0.4.2" + version = ">= 0.6.2" source = "github.com/ethanmdavidson/git" } proxmox = { - version = ">= 1.1.6" + version = "= 1.2.1" source = "github.com/hashicorp/proxmox" } } @@ -100,7 +100,7 @@ locals { // Defines the builder configuration blocks. source "proxmox-iso" "linux-opensuse-leap" { - + // Proxmox Connection Settings and Credentials proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json" username = "${var.proxmox_api_token_id}" @@ -119,12 +119,14 @@ source "proxmox-iso" "linux-opensuse-leap" { memory = "${var.vm_mem_size}" os = "${var.vm_os_type}" scsi_controller = "${var.vm_disk_controller_type}" + disks { disk_size = "${var.vm_disk_size}" type = "${var.vm_disk_type}" storage_pool = "${var.vm_storage_pool}" format = "${var.vm_disk_format}" } + dynamic "efi_config" { for_each = var.vm_bios == "ovmf" ? [1] : [] content { @@ -133,13 +135,11 @@ source "proxmox-iso" "linux-opensuse-leap" { pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null } } - unmount_iso = true + ssh_username = "${var.build_username}" ssh_password = "${var.build_password}" ssh_timeout = "${var.timeout}" ssh_port = "22" - iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" - iso_checksum = "${var.iso_checksum}" qemu_agent = true network_adapters { @@ -152,6 +152,7 @@ source "proxmox-iso" "linux-opensuse-leap" { http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null // Boot and Provisioning Settings + http_interface = var.common_data_source == "http" ? var.common_http_interface : null http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null @@ -159,6 +160,12 @@ source "proxmox-iso" "linux-opensuse-leap" { boot_wait = var.vm_boot_wait boot_command = local.boot_command + boot_iso { + iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" + unmount = true + iso_checksum = "${var.iso_checksum}" + } + dynamic "additional_iso_files" { for_each = var.common_data_source == "disk" ? [1] : [] content { diff --git a/builds/linux/opensuse/leap-15-6/variables.pkr.hcl b/builds/linux/opensuse/leap-15-6/variables.pkr.hcl index 54e0a69..93439fd 100644 --- a/builds/linux/opensuse/leap-15-6/variables.pkr.hcl +++ b/builds/linux/opensuse/leap-15-6/variables.pkr.hcl @@ -215,6 +215,12 @@ variable "common_http_bind_address" { default = null } +variable "common_http_interface" { + type = string + description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface." + default = null +} + variable "common_http_port_min" { type = number description = "The start of the HTTP port range." @@ -250,7 +256,7 @@ variable "common_shutdown_timeout" { variable "build_username" { type = string description = "The username to login to the guest operating system. (e.g. 'ubuntu')" -# sensitive = true +# sensitive = true } variable "build_password" { @@ -304,4 +310,4 @@ variable "additional_packages" { type = list(string) description = "Additional packages to install." default = [] -} \ No newline at end of file +} diff --git a/builds/linux/oracle/8/linux-oracle.pkr.hcl b/builds/linux/oracle/8/linux-oracle.pkr.hcl index 8b0c648..52251e6 100644 --- a/builds/linux/oracle/8/linux-oracle.pkr.hcl +++ b/builds/linux/oracle/8/linux-oracle.pkr.hcl @@ -7,7 +7,7 @@ // The Packer configuration. packer { - required_version = ">= 1.11.0" + required_version = ">= 1.12.0" required_plugins { ansible = { source = "github.com/hashicorp/ansible" @@ -18,7 +18,7 @@ packer { source = "github.com/ethanmdavidson/git" } proxmox = { - version = ">= 1.1.8" + version = "= 1.2.1" source = "github.com/hashicorp/proxmox" } } @@ -36,7 +36,7 @@ locals { bios_boot_command = [ // This sends the "up arrow" key, typically used to navigate through boot menu options. "", - // This sends the "tab" key. In the BIOS bootloader, this is how you customize the boot options. + // This sends the "tab" key. In the BIOS bootloader, this is how you customize the boot options. "", "inst.text biosdevname=0 net.ifnames=0 inst.gpt", " ${local.data_source_command}", @@ -103,7 +103,7 @@ locals { // Defines the builder configuration blocks. source "proxmox-iso" "linux-oracle" { - + // Proxmox Connection Settings and Credentials proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json" username = "${var.proxmox_api_token_id}" @@ -122,12 +122,14 @@ source "proxmox-iso" "linux-oracle" { memory = "${var.vm_mem_size}" os = "${var.vm_os_type}" scsi_controller = "${var.vm_disk_controller_type}" + disks { disk_size = "${var.vm_disk_size}" type = "${var.vm_disk_type}" storage_pool = "${var.vm_storage_pool}" format = "${var.vm_disk_format}" } + dynamic "efi_config" { for_each = var.vm_bios == "ovmf" ? [1] : [] content { @@ -136,13 +138,11 @@ source "proxmox-iso" "linux-oracle" { pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null } } - unmount_iso = true + ssh_username = "${var.build_username}" ssh_password = "${var.build_password}" ssh_timeout = "${var.timeout}" ssh_port = "22" - iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" - iso_checksum = "${var.iso_checksum}" qemu_agent = true network_adapters { @@ -155,6 +155,7 @@ source "proxmox-iso" "linux-oracle" { http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null // Boot and Provisioning Settings + http_interface = var.common_data_source == "http" ? var.common_http_interface : null http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null @@ -162,6 +163,12 @@ source "proxmox-iso" "linux-oracle" { boot_wait = var.vm_boot_wait boot_command = local.boot_command + boot_iso { + iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" + unmount = true + iso_checksum = "${var.iso_checksum}" + } + dynamic "additional_iso_files" { for_each = var.common_data_source == "disk" ? [1] : [] content { diff --git a/builds/linux/oracle/8/variables.pkr.hcl b/builds/linux/oracle/8/variables.pkr.hcl index e539bbe..01de9e9 100644 --- a/builds/linux/oracle/8/variables.pkr.hcl +++ b/builds/linux/oracle/8/variables.pkr.hcl @@ -215,6 +215,12 @@ variable "common_http_bind_address" { default = null } +variable "common_http_interface" { + type = string + description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface." + default = null +} + variable "common_http_port_min" { type = number description = "The start of the HTTP port range." @@ -250,7 +256,7 @@ variable "common_shutdown_timeout" { variable "build_username" { type = string description = "The username to login to the guest operating system. (e.g. 'ubuntu')" -# sensitive = true +# sensitive = true } variable "build_password" { @@ -304,4 +310,4 @@ variable "additional_packages" { type = list(string) description = "Additional packages to install." default = [] -} \ No newline at end of file +} diff --git a/builds/linux/oracle/9/linux-oracle.pkr.hcl b/builds/linux/oracle/9/linux-oracle.pkr.hcl index 58a19d3..54c5cb2 100644 --- a/builds/linux/oracle/9/linux-oracle.pkr.hcl +++ b/builds/linux/oracle/9/linux-oracle.pkr.hcl @@ -7,7 +7,7 @@ // The Packer configuration. packer { - required_version = ">= 1.11.0" + required_version = ">= 1.12.0" required_plugins { ansible = { source = "github.com/hashicorp/ansible" @@ -18,7 +18,7 @@ packer { source = "github.com/ethanmdavidson/git" } proxmox = { - version = ">= 1.1.8" + version = "= 1.2.1" source = "github.com/hashicorp/proxmox" } } @@ -36,7 +36,7 @@ locals { bios_boot_command = [ // This sends the "up arrow" key, typically used to navigate through boot menu options. "", - // This sends the "tab" key. In the BIOS bootloader, this is how you customize the boot options. + // This sends the "tab" key. In the BIOS bootloader, this is how you customize the boot options. "", "inst.text biosdevname=0 net.ifnames=0 inst.gpt", " ${local.data_source_command}", @@ -103,7 +103,7 @@ locals { // Defines the builder configuration blocks. source "proxmox-iso" "linux-oracle" { - + // Proxmox Connection Settings and Credentials proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json" username = "${var.proxmox_api_token_id}" @@ -122,12 +122,14 @@ source "proxmox-iso" "linux-oracle" { memory = "${var.vm_mem_size}" os = "${var.vm_os_type}" scsi_controller = "${var.vm_disk_controller_type}" + disks { disk_size = "${var.vm_disk_size}" type = "${var.vm_disk_type}" storage_pool = "${var.vm_storage_pool}" format = "${var.vm_disk_format}" } + dynamic "efi_config" { for_each = var.vm_bios == "ovmf" ? [1] : [] content { @@ -136,13 +138,11 @@ source "proxmox-iso" "linux-oracle" { pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null } } - unmount_iso = true + ssh_username = "${var.build_username}" ssh_password = "${var.build_password}" ssh_timeout = "${var.timeout}" ssh_port = "22" - iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" - iso_checksum = "${var.iso_checksum}" qemu_agent = true network_adapters { @@ -155,6 +155,7 @@ source "proxmox-iso" "linux-oracle" { http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null // Boot and Provisioning Settings + http_interface = var.common_data_source == "http" ? var.common_http_interface : null http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null @@ -162,6 +163,12 @@ source "proxmox-iso" "linux-oracle" { boot_wait = var.vm_boot_wait boot_command = local.boot_command + boot_iso { + iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" + unmount = true + iso_checksum = "${var.iso_checksum}" + } + dynamic "additional_iso_files" { for_each = var.common_data_source == "disk" ? [1] : [] content { diff --git a/builds/linux/oracle/9/variables.pkr.hcl b/builds/linux/oracle/9/variables.pkr.hcl index e1715c7..223bc96 100644 --- a/builds/linux/oracle/9/variables.pkr.hcl +++ b/builds/linux/oracle/9/variables.pkr.hcl @@ -215,6 +215,12 @@ variable "common_http_bind_address" { default = null } +variable "common_http_interface" { + type = string + description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface." + default = null +} + variable "common_http_port_min" { type = number description = "The start of the HTTP port range." @@ -250,7 +256,7 @@ variable "common_shutdown_timeout" { variable "build_username" { type = string description = "The username to login to the guest operating system. (e.g. 'ubuntu')" -# sensitive = true +# sensitive = true } variable "build_password" { @@ -304,4 +310,4 @@ variable "additional_packages" { type = list(string) description = "Additional packages to install." default = [] -} \ No newline at end of file +} diff --git a/builds/linux/rocky/8/linux-rocky.pkr.hcl b/builds/linux/rocky/8/linux-rocky.pkr.hcl index 9f93bcc..0b45e19 100644 --- a/builds/linux/rocky/8/linux-rocky.pkr.hcl +++ b/builds/linux/rocky/8/linux-rocky.pkr.hcl @@ -7,18 +7,18 @@ // The Packer configuration. packer { - required_version = ">= 1.9.1" + required_version = ">= 1.12.0" required_plugins { ansible = { source = "github.com/hashicorp/ansible" version = "~> 1" } git = { - version = ">= 0.4.2" + version = ">= 0.6.2" source = "github.com/ethanmdavidson/git" } proxmox = { - version = ">= 1.0.6" + version = "= 1.2.1" source = "github.com/hashicorp/proxmox" } } @@ -53,7 +53,7 @@ locals { "text ${local.data_source_command}", // This sends the "enter" key, waits, turns on the left control key, sends the "x" key, and then turns off the left control key. This is used to save the changes and exit the boot menu option's configuration, and then continue the boot process. "x" - ] + ] build_by = "Built by: HashiCorp Packer ${packer.version}" build_date = formatdate("DD-MM-YYYY hh:mm ZZZ", "${timestamp()}" ) @@ -103,7 +103,7 @@ locals { // Defines the builder configuration blocks. source "proxmox-iso" "linux-rocky" { - + // Proxmox Connection Settings and Credentials proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json" username = "${var.proxmox_api_token_id}" @@ -122,12 +122,14 @@ source "proxmox-iso" "linux-rocky" { memory = "${var.vm_mem_size}" os = "${var.vm_os_type}" scsi_controller = "${var.vm_disk_controller_type}" + disks { disk_size = "${var.vm_disk_size}" type = "${var.vm_disk_type}" storage_pool = "${var.vm_storage_pool}" format = "${var.vm_disk_format}" } + dynamic "efi_config" { for_each = var.vm_bios == "ovmf" ? [1] : [] content { @@ -136,13 +138,11 @@ source "proxmox-iso" "linux-rocky" { pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null } } - unmount_iso = true + ssh_username = "${var.build_username}" ssh_password = "${var.build_password}" ssh_timeout = "${var.timeout}" ssh_port = "22" - iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" - iso_checksum = "${var.iso_checksum}" qemu_agent = true network_adapters { @@ -155,6 +155,7 @@ source "proxmox-iso" "linux-rocky" { http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null // Boot and Provisioning Settings + http_interface = var.common_data_source == "http" ? var.common_http_interface : null http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null @@ -162,6 +163,12 @@ source "proxmox-iso" "linux-rocky" { boot_wait = var.vm_boot_wait boot_command = local.boot_command + boot_iso { + iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" + unmount = true + iso_checksum = "${var.iso_checksum}" + } + dynamic "additional_iso_files" { for_each = var.common_data_source == "disk" ? [1] : [] content { diff --git a/builds/linux/rocky/8/variables.pkr.hcl b/builds/linux/rocky/8/variables.pkr.hcl index 2989464..41938b0 100644 --- a/builds/linux/rocky/8/variables.pkr.hcl +++ b/builds/linux/rocky/8/variables.pkr.hcl @@ -215,6 +215,12 @@ variable "common_http_bind_address" { default = null } +variable "common_http_interface" { + type = string + description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface." + default = null +} + variable "common_http_port_min" { type = number description = "The start of the HTTP port range." @@ -250,7 +256,7 @@ variable "common_shutdown_timeout" { variable "build_username" { type = string description = "The username to login to the guest operating system. (e.g. 'ubuntu')" -# sensitive = true +# sensitive = true } variable "build_password" { @@ -304,4 +310,4 @@ variable "additional_packages" { type = list(string) description = "Additional packages to install." default = [] -} \ No newline at end of file +} diff --git a/builds/linux/rocky/9/linux-rocky.pkr.hcl b/builds/linux/rocky/9/linux-rocky.pkr.hcl index 4c9b15d..1076a9e 100644 --- a/builds/linux/rocky/9/linux-rocky.pkr.hcl +++ b/builds/linux/rocky/9/linux-rocky.pkr.hcl @@ -7,18 +7,18 @@ // The Packer configuration. packer { - required_version = ">= 1.9.1" + required_version = ">= 1.12.0" required_plugins { ansible = { source = "github.com/hashicorp/ansible" version = "~> 1" } git = { - version = ">= 0.4.2" + version = ">= 0.6.2" source = "github.com/ethanmdavidson/git" } proxmox = { - version = ">= 1.0.6" + version = "= 1.2.1" source = "github.com/hashicorp/proxmox" } } @@ -103,7 +103,7 @@ locals { // Defines the builder configuration blocks. source "proxmox-iso" "linux-rocky" { - + // Proxmox Connection Settings and Credentials proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json" username = "${var.proxmox_api_token_id}" @@ -122,12 +122,14 @@ source "proxmox-iso" "linux-rocky" { memory = "${var.vm_mem_size}" os = "${var.vm_os_type}" scsi_controller = "${var.vm_disk_controller_type}" + disks { disk_size = "${var.vm_disk_size}" type = "${var.vm_disk_type}" storage_pool = "${var.vm_storage_pool}" format = "${var.vm_disk_format}" } + dynamic "efi_config" { for_each = var.vm_bios == "ovmf" ? [1] : [] content { @@ -136,13 +138,11 @@ source "proxmox-iso" "linux-rocky" { pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null } } - unmount_iso = true + ssh_username = "${var.build_username}" ssh_password = "${var.build_password}" ssh_timeout = "${var.timeout}" ssh_port = "22" - iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" - iso_checksum = "${var.iso_checksum}" qemu_agent = true network_adapters { @@ -155,6 +155,7 @@ source "proxmox-iso" "linux-rocky" { http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null // Boot and Provisioning Settings + http_interface = var.common_data_source == "http" ? var.common_http_interface : null http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null @@ -162,6 +163,12 @@ source "proxmox-iso" "linux-rocky" { boot_wait = var.vm_boot_wait boot_command = local.boot_command + boot_iso { + iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" + unmount = true + iso_checksum = "${var.iso_checksum}" + } + dynamic "additional_iso_files" { for_each = var.common_data_source == "disk" ? [1] : [] content { diff --git a/builds/linux/rocky/9/variables.pkr.hcl b/builds/linux/rocky/9/variables.pkr.hcl index 1751228..b3db96b 100644 --- a/builds/linux/rocky/9/variables.pkr.hcl +++ b/builds/linux/rocky/9/variables.pkr.hcl @@ -215,6 +215,12 @@ variable "common_http_bind_address" { default = null } +variable "common_http_interface" { + type = string + description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface." + default = null +} + variable "common_http_port_min" { type = number description = "The start of the HTTP port range." @@ -250,7 +256,7 @@ variable "common_shutdown_timeout" { variable "build_username" { type = string description = "The username to login to the guest operating system. (e.g. 'ubuntu')" -# sensitive = true +# sensitive = true } variable "build_password" { @@ -304,4 +310,4 @@ variable "additional_packages" { type = list(string) description = "Additional packages to install." default = [] -} \ No newline at end of file +} diff --git a/builds/linux/ubuntu/20-04-lts/linux-ubuntu.pkr.hcl b/builds/linux/ubuntu/20-04-lts/linux-ubuntu.pkr.hcl index 1681d56..06a9ad4 100644 --- a/builds/linux/ubuntu/20-04-lts/linux-ubuntu.pkr.hcl +++ b/builds/linux/ubuntu/20-04-lts/linux-ubuntu.pkr.hcl @@ -7,18 +7,18 @@ // The Packer configuration. packer { - required_version = ">= 1.9.1" + required_version = ">= 1.12.0" required_plugins { ansible = { source = "github.com/hashicorp/ansible" version = "~> 1" } git = { - version = ">= 0.4.2" + version = ">= 0.6.2" source = "github.com/ethanmdavidson/git" } proxmox = { - version = ">= 1.0.6" + version = "= 1.2.1" source = "github.com/hashicorp/proxmox" } } @@ -110,7 +110,7 @@ locals { // Defines the builder configuration blocks. source "proxmox-iso" "ubuntu" { - + // Proxmox Connection Settings and Credentials proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json" username = "${var.proxmox_api_token_id}" @@ -129,12 +129,14 @@ source "proxmox-iso" "ubuntu" { memory = "${var.vm_mem_size}" os = "${var.vm_os_type}" scsi_controller = "${var.vm_disk_controller_type}" + disks { disk_size = "${var.vm_disk_size}" type = "${var.vm_disk_type}" storage_pool = "${var.vm_storage_pool}" format = "${var.vm_disk_format}" } + dynamic "efi_config" { for_each = var.vm_bios == "ovmf" ? [1] : [] content { @@ -143,13 +145,11 @@ source "proxmox-iso" "ubuntu" { pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null } } - unmount_iso = true + ssh_username = "${var.build_username}" ssh_password = "${var.build_password}" ssh_timeout = "${var.timeout}" ssh_port = "22" - iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" - iso_checksum = "${var.iso_checksum}" qemu_agent = true network_adapters { @@ -162,6 +162,7 @@ source "proxmox-iso" "ubuntu" { http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null // Boot and Provisioning Settings + http_interface = var.common_data_source == "http" ? var.common_http_interface : null http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null @@ -169,6 +170,12 @@ source "proxmox-iso" "ubuntu" { boot_wait = var.vm_boot_wait boot_command = local.boot_command + boot_iso { + iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" + unmount = true + iso_checksum = "${var.iso_checksum}" + } + dynamic "additional_iso_files" { for_each = var.common_data_source == "disk" ? [1] : [] content { diff --git a/builds/linux/ubuntu/20-04-lts/variables.pkr.hcl b/builds/linux/ubuntu/20-04-lts/variables.pkr.hcl index 3e89fed..ec7a706 100644 --- a/builds/linux/ubuntu/20-04-lts/variables.pkr.hcl +++ b/builds/linux/ubuntu/20-04-lts/variables.pkr.hcl @@ -215,6 +215,12 @@ variable "common_http_bind_address" { default = null } +variable "common_http_interface" { + type = string + description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface." + default = null +} + variable "common_http_port_min" { type = number description = "The start of the HTTP port range." @@ -250,7 +256,7 @@ variable "common_shutdown_timeout" { variable "build_username" { type = string description = "The username to login to the guest operating system. (e.g. 'ubuntu')" -# sensitive = true +# sensitive = true } variable "build_password" { @@ -304,4 +310,4 @@ variable "additional_packages" { type = list(string) description = "Additional packages to install." default = [] -} \ No newline at end of file +} diff --git a/builds/linux/ubuntu/22-04-lts/linux-ubuntu.pkr.hcl b/builds/linux/ubuntu/22-04-lts/linux-ubuntu.pkr.hcl index 3b31787..128fca1 100644 --- a/builds/linux/ubuntu/22-04-lts/linux-ubuntu.pkr.hcl +++ b/builds/linux/ubuntu/22-04-lts/linux-ubuntu.pkr.hcl @@ -7,18 +7,18 @@ // The Packer configuration. packer { - required_version = ">= 1.9.1" + required_version = ">= 1.12.0" required_plugins { ansible = { source = "github.com/hashicorp/ansible" version = "~> 1" } git = { - version = ">= 0.4.2" + version = ">= 0.6.2" source = "github.com/ethanmdavidson/git" } proxmox = { - version = ">= 1.0.6" + version = "= 1.2.1" source = "github.com/hashicorp/proxmox" } } @@ -106,7 +106,7 @@ locals { // Defines the builder configuration blocks. source "proxmox-iso" "ubuntu" { - + // Proxmox Connection Settings and Credentials proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json" username = "${var.proxmox_api_token_id}" @@ -125,12 +125,14 @@ source "proxmox-iso" "ubuntu" { memory = "${var.vm_mem_size}" os = "${var.vm_os_type}" scsi_controller = "${var.vm_disk_controller_type}" + disks { disk_size = "${var.vm_disk_size}" type = "${var.vm_disk_type}" storage_pool = "${var.vm_storage_pool}" format = "${var.vm_disk_format}" } + dynamic "efi_config" { for_each = var.vm_bios == "ovmf" ? [1] : [] content { @@ -139,13 +141,11 @@ source "proxmox-iso" "ubuntu" { pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null } } - unmount_iso = true + ssh_username = "${var.build_username}" ssh_password = "${var.build_password}" ssh_timeout = "${var.timeout}" ssh_port = "22" - iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" - iso_checksum = "${var.iso_checksum}" qemu_agent = true network_adapters { @@ -158,6 +158,7 @@ source "proxmox-iso" "ubuntu" { http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null // Boot and Provisioning Settings + http_interface = var.common_data_source == "http" ? var.common_http_interface : null http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null @@ -165,6 +166,12 @@ source "proxmox-iso" "ubuntu" { boot_wait = var.vm_boot_wait boot_command = local.boot_command + boot_iso { + iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" + unmount = true + iso_checksum = "${var.iso_checksum}" + } + dynamic "additional_iso_files" { for_each = var.common_data_source == "disk" ? [1] : [] content { diff --git a/builds/linux/ubuntu/22-04-lts/variables.pkr.hcl b/builds/linux/ubuntu/22-04-lts/variables.pkr.hcl index 7a9197a..2ac8974 100644 --- a/builds/linux/ubuntu/22-04-lts/variables.pkr.hcl +++ b/builds/linux/ubuntu/22-04-lts/variables.pkr.hcl @@ -215,6 +215,12 @@ variable "common_http_bind_address" { default = null } +variable "common_http_interface" { + type = string + description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface." + default = null +} + variable "common_http_port_min" { type = number description = "The start of the HTTP port range." @@ -250,7 +256,7 @@ variable "common_shutdown_timeout" { variable "build_username" { type = string description = "The username to login to the guest operating system. (e.g. 'ubuntu')" -# sensitive = true +# sensitive = true } variable "build_password" { @@ -304,4 +310,4 @@ variable "additional_packages" { type = list(string) description = "Additional packages to install." default = [] -} \ No newline at end of file +} diff --git a/builds/linux/ubuntu/24-04-lts/linux-ubuntu.pkr.hcl b/builds/linux/ubuntu/24-04-lts/linux-ubuntu.pkr.hcl index 912d164..7642c44 100644 --- a/builds/linux/ubuntu/24-04-lts/linux-ubuntu.pkr.hcl +++ b/builds/linux/ubuntu/24-04-lts/linux-ubuntu.pkr.hcl @@ -7,18 +7,18 @@ // The Packer configuration. packer { - required_version = ">= 1.9.1" + required_version = ">= 1.12.0" required_plugins { ansible = { source = "github.com/hashicorp/ansible" version = "~> 1" } git = { - version = ">= 0.4.2" + version = ">= 0.6.2" source = "github.com/ethanmdavidson/git" } proxmox = { - version = ">= 1.0.6" + version = "= 1.2.1" source = "github.com/hashicorp/proxmox" } } @@ -106,7 +106,7 @@ locals { // Defines the builder configuration blocks. source "proxmox-iso" "ubuntu" { - + // Proxmox Connection Settings and Credentials proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json" username = "${var.proxmox_api_token_id}" @@ -125,12 +125,14 @@ source "proxmox-iso" "ubuntu" { memory = "${var.vm_mem_size}" os = "${var.vm_os_type}" scsi_controller = "${var.vm_disk_controller_type}" + disks { disk_size = "${var.vm_disk_size}" type = "${var.vm_disk_type}" storage_pool = "${var.vm_storage_pool}" format = "${var.vm_disk_format}" } + dynamic "efi_config" { for_each = var.vm_bios == "ovmf" ? [1] : [] content { @@ -139,13 +141,11 @@ source "proxmox-iso" "ubuntu" { pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null } } - unmount_iso = true + ssh_username = "${var.build_username}" ssh_password = "${var.build_password}" ssh_timeout = "${var.timeout}" ssh_port = "22" - iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" - iso_checksum = "${var.iso_checksum}" qemu_agent = true network_adapters { @@ -158,6 +158,7 @@ source "proxmox-iso" "ubuntu" { http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null // Boot and Provisioning Settings + http_interface = var.common_data_source == "http" ? var.common_http_interface : null http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null @@ -165,6 +166,12 @@ source "proxmox-iso" "ubuntu" { boot_wait = var.vm_boot_wait boot_command = local.boot_command + boot_iso { + iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}" + unmount = true + iso_checksum = "${var.iso_checksum}" + } + dynamic "additional_iso_files" { for_each = var.common_data_source == "disk" ? [1] : [] content { diff --git a/builds/linux/ubuntu/24-04-lts/variables.pkr.hcl b/builds/linux/ubuntu/24-04-lts/variables.pkr.hcl index 01f9028..853d0b4 100644 --- a/builds/linux/ubuntu/24-04-lts/variables.pkr.hcl +++ b/builds/linux/ubuntu/24-04-lts/variables.pkr.hcl @@ -215,6 +215,12 @@ variable "common_http_bind_address" { default = null } +variable "common_http_interface" { + type = string + description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface." + default = null +} + variable "common_http_port_min" { type = number description = "The start of the HTTP port range." @@ -250,7 +256,7 @@ variable "common_shutdown_timeout" { variable "build_username" { type = string description = "The username to login to the guest operating system. (e.g. 'ubuntu')" -# sensitive = true +# sensitive = true } variable "build_password" { @@ -304,4 +310,4 @@ variable "additional_packages" { type = list(string) description = "Additional packages to install." default = [] -} \ No newline at end of file +}