Skip to content

Instantly share code, notes, and snippets.

@meaty-popsicle
Last active November 23, 2021 14:49
Show Gist options
  • Save meaty-popsicle/969a542c37bfa8b972d466de9f7bcedc to your computer and use it in GitHub Desktop.
Save meaty-popsicle/969a542c37bfa8b972d466de9f7bcedc to your computer and use it in GitHub Desktop.
Proxmox packer.
variable "proxmox_host" {}
variable "proxmox_url" {
type = string
}
variable "proxmox_username" {
type = string
sensitive = true
}
variable "proxmox_password" {
type = string
sensitive = true
}
variable "proxmox_skip_tls_verify" {
type = string
}
variable "vm_name" {
type = string
}
variable "template_description" {
type = string
}
variable "vm_cpu_cores" {
type = string
}
variable "vm_memory" {
type = string
}
variable "vm_disk_size" {
type = string
}
variable "iso_file" {
type = string
}
variable "winrm_password" {
type = string
sensitive = true
}
variable "winrm_username" {
type = string
sensitive = true
}
packer {
required_plugins {
proxmox = {
version = ">= 1.0.3"
source = "github.com/hashicorp/proxmox"
}
}
}
source "proxmox-iso" "autogenerated_1" {
efidisk = "local-lvm" # Presence of this variable crashes the build
machine = "q35" # Presence of this variable crashes the build
additional_iso_files {
# ...
}
additional_iso_files {
# ...
}
communicator = "winrm"
cores = "${var.vm_cpu_cores}"
cpu_type = "host"
disks {
# ...
}
disks {
# ...
}
insecure_skip_tls_verify = "${var.proxmox_skip_tls_verify}"
iso_file = "${var.iso_file}"
iso_storage_pool = "local"
memory = "${var.vm_memory}"
network_adapters {
bridge = "vmbr0"
model = "virtio"
}
node = "${var.proxmox_host}"
os = "win10"
password = "${var.proxmox_password}"
proxmox_url = "${var.proxmox_url}"
template_description = "${var.template_description}"
unmount_iso = true
username = "${var.proxmox_username}"
vm_name = "${var.vm_name}"
winrm_insecure = true
winrm_password = "${var.winrm_password}"
winrm_use_ssl = true
winrm_username = "${var.winrm_username}"
}
build {
# ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment