feat: Add Packer build automation scripts
Some checks are pending
Build and Release / build-sign-package (push) Waiting to run

- Added packer/variables.pkr.hcl with configurable variables
- Added build-template.sh with interactive build script
- Added .env.example for environment configuration
- Updated windows.pkr.hcl to use variables
- Supports environment variables and command line arguments
This commit is contained in:
root 2026-02-06 16:01:52 +00:00
parent e4f03427b7
commit 61ae0d0a07
4 changed files with 315 additions and 17 deletions

View file

@ -8,51 +8,52 @@ packer {
}
source "proxmox-iso" "windows-11" {
proxmox_url = "https://proxmox-host:8006/api2/json"
username = "root@pam"
password = "secret"
node = "la-vmh-07"
proxmox_url = "${var.proxmox_url}"
username = "${var.proxmox_username}"
password = "${var.proxmox_password}"
node = "${var.proxmox_node}"
vm_name = "win11-ltsc-template"
vm_name = "${var.vm_name}"
template_description = "Built with Packer on ${timestamp()}"
iso_file = "local:iso/CLIENT_LTSC_EVAL_x64FRE_en-us.iso"
iso_file = "${var.iso_storage}:iso/${var.windows_iso}"
qemu_agent = true
cores = 4
memory = 8192
cores = "${var.vm_cores}"
memory = "${var.vm_memory}"
machine = "q35"
bios = "ovmf"
efi_config {
efi_storage_pool = "local-lvm"
efi_storage_pool = "${var.disk_storage}"
pre_enrolled_keys = true
}
tpm_config {
version = "2.0"
tpm_storage_pool = "local-lvm"
tpm_storage_pool = "${var.disk_storage}"
}
scsi_controller = "virtio-scsi-pci"
disks {
disk_size = "60G"
storage_pool = "local-lvm"
disk_size = "${var.vm_disk_size}"
storage_pool = "${var.disk_storage}"
type = "virtio"
format = "raw"
cache_mode = "writeback"
}
additional_iso_files {
device = "sata1"
iso_file = "local:iso/virtio-win.iso"
device = "sata1"
iso_file = "${var.virtio_iso}"
}
communicator = "winrm"
winrm_username = "Administrator"
winrm_password = "PackerPassword123!"
winrm_password = "${var.winrm_password}"
winrm_insecure = true
winrm_use_ssl = true
boot_command = [
"<wait><wait><wait>","<enter><wait>","<enter><wait>",
"<enter><wait>","<enter>"
"<wait><wait><wait>", "<enter><wait>", "<enter><wait>",
"<enter><wait>", "<enter>"
]
boot_wait = "10s"
}