fix: update boot_iso section, fix var names, and pin proxmox plugin version
This commit is contained in:
@@ -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.
|
||||
"<up>",
|
||||
// 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.
|
||||
"<tab>",
|
||||
"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 {
|
||||
|
||||
@@ -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 = []
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user