Skip to content

dylanbegin/packer

Repository files navigation

Warning

This README is still under development!

logo Packer Templates for Proxmox

Important

This repo is built for my own environment so please review all configurations to verify compatibility!

This repo is used to build Packer template files used in Proxmox and ready for cloudinit/Terraform deployments.

Features used in these templates are:

  • Bare minimal installations.
  • UEFI images with TTYS enabled.
  • Single 10GB root volume.
  • Includes cloudinit for terraform deployments.
  • Includes QEMU guest agent.
  • Includes Docker, Hashicorp, and community repos (when availible).

TODO features to add:

  • CIS/STIG hardening
  • Secureboot/TPM

Tip

This repo is part of my IaC automation series. If you are building this in mind please follow my repo's in the order below.

  1. terraform-iso-get
  2. you are here packer
  3. terraform-core
  4. ansible
  5. terraform-talos
  6. k8s-apps

ISO Setup

The Packer builder is configured to boot from an ISO. There are two aproaches to using a ISO, download the file from a URL or mount from a file. This repo is configured to use the file method but if you want to use a URL you can read the Proxmox ISO Builder for configuration details.

Build Your Secrets File

Keeping in best practice, this repo does not contain any sensitive information. You will need to create a directory outside of this git repo on a properly encrypted disk/usb to save the secrets file. Below is the template needed for the file which needs to be named pkr-secrets.pkrvars.hcl. The builds will run using the root (password packer) account temporarily and then disable the account. This means you will need to supply the primary user when you deploy a vm with something such as cloudinit/Terraform.

# This is a sensitive file. Do not share!
# All variables for all Packer files.

proxmox_hostname = "pve1.example.com:8006"
proxmox_api_id = "username@pam!build"
proxmox_api_secret = "API-KEY-HERE"

Building Packer Templates

Packer usage ref:


├─ http
│ ├─ base        # base files for all images
│ └─ <image>     # additional files for the image
├─ packer-config # base config applied to all images
├─ packer-vars   # base variables applied to all images
└─ <image>       # variables custom to the image

Each image has it's own variables file so all you need to do is define the correct OS file and your secrets file.

Init/upgrade Packer modules:

packer init -upgrade .

Validate the packer build with:

packer validate \
-var-file=<image>.pkrvars.hcl \
-var-file=/path/to/secrets/pkr-secrets.pkrvars.hcl .

Run the Packer build with:

packer build \
-var-file=<image>.pkrvars.hcl \
-var-file=/path/to/secrets/pkr-secrets.pkrvars.hcl .

Current Images Supported

Important

Distro flavor choice is based off the latest, stable, slim version availible.

OS Version VMID Status
Alma 9.5 1000 Completed
Alpine 3.21 1001 Completed
Antix 22 1002
󰣇 Arch rolling 1003
Artix rolling 1004
Centos Streams 10 1005 Completed
ClearOS rolling 1006
Core 15 1007
󰣚 Debian 12.9 1008 Commpleted
Elementary 7.1 1009
Endeavour Gemini 1010
󰣛 Fedora 41 1011 Completed
󰣠 FreeBSD 13.3 1012
󰣨 Gentoo rolling 1013
Kali rolling 1014 initrd err
Kali Purple rolling 1015
󱘊 Manjaro 23.1 1016
󰣭 Mint 22.2 1017
󱄅 Nix 23.11 1018
OpenBSD 7.5 1019
OpenSUSE Tumbleweed 1020
Parrot 6.2 1021
Peppermint rolling 1022
Pop! 22.04 1023
QubesOS 4.2 1024
Rocky 9.5 1025 Completed
󰕈 Ubuntu 24.10 1027 Completed
Vanilla 22.10 1028
Void glibc 1029
Windows 11 1030
Zorin 17.1 1031

[!WARNING]

Acknowledgements

Huge shout out to Pumba98 for his excellent repo which much of this was inspired. You can find his repo here: github.com/Pumba98/proxmox-packer-templates)

Releases

No releases published

Packages

No packages published

Languages