This is a tool for creating Ubuntu Cloud-Init templates on Proxmox using Packer.
-
Configure the
/scripts/uploads/ssh-credentials.auto.pkvars.hcl
file with the appropriate credentials to SSH into the Proxmox host. -
Configure build variables using the
/packer/template.auto.pkrvars.hcl
file. -
Run the following command from the top-level directory using one of two options:
a. Running Packer directly:
make
This will:
- Initialize Packer
- Format the .hcl files
- Validate the Packer configuration
- Build the Proxmox template
b. Running Packer via Docker Compose:
make run
Expected Outcome:
- Runs the
packer build
command within a Docker container.
-
The image will be built and uploaded to the Proxmox host.
-
Clone the image to generate a usable VM.
-
Configure settings in the
Cloud-Init
section, as needed.The default user is
ubuntu
-
Downloads the cloud image on the Packer host
-
Uploads the image to the Proxmox host
-
Uploads the personalization script in uploads
-
Injects necessary environment variables
-
Uploads the create-template script and runs it:
-
Adds/updates libguestfs-tools for the virt-customize tool
-
Resizes the cloud image
-
Adds the QEMU Guest Agent to the cloud image
-
Runs the personalization script:
- Adds configuration for local Apt-Cacher-NG server
- Adds systemd-resolved DNS over TLS configuration
- Installs Chrony
- Adds local NTP server to Chrony
- Adds executable
update
shell script to /usr/sbin - Modifies mirror URL to local mirror
-
Removes the personalization script fromtmp
-
Removes pre-existing template
-
Creates new template
-
Removes any dangling .img files from /tmp
-