Skip to content

Build customizable Ubuntu images with shared PDS recipes - #4

Merged
michielvha merged 68 commits into
mainfrom
feat/0001-packer-proxmox-native
Nov 6, 2026
Merged

michielvha merged 68 commits into
mainfrom
feat/0001-packer-proxmox-native

Conversation

@michielvha

@michielvha michielvha commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1. Closes #3. The wider automated multi-OS test harness remains in #2.

Build Ubuntu as a portable qcow2/raw disk or an optional native Proxmox template. Both paths install an exact verified PDS package, run the selected Bash recipe, then seal build access and machine identity. Deployment cloud-init supplies the real users, keys and hostname.

The default recipe selects Zi/Powerlevel10k, configurable VHCO branding, GitHub CLI, kubectl/Krew plugins, midnight package updates and key-only SSH with root login disabled. Custom recipes can omit those policy calls. PDS remains standalone; PDS #35 is merged and 0.20.0 is published through the signed repository.

Base preparation runs off-node, with replacement-machine recovery documented. Proxmox needs no Packer/libguestfs installation. Its configurable CPU model defaults to host. Short READMEs link build, recipe, SSH/debugging and recovery guides. Dedicated guides also retain host setup, manual QEMU boot, raw mounts/chroot and legacy ARM/U-Boot examples. The manual amd64 seed passes cloud-init schema and ISO checks; manual host-QEMU and legacy ARM boots are not newly runtime-validated.

Validation:

  • Fresh base preparation and two imports of the same bundle pass; occupied/corrupt inputs are refused.
  • All four default/custom native/portable builds pass sealed-disk inspection. Both raw/qcow2 pairs compare equal.
  • Eight fresh deployments pass, with distinct identities and keys. Default deployments pass real update execution, positive/negative SSH controls and two total reboot checks, one per output.
  • Every owned test resource is removed. The six pre-existing guests' configuration hashes/power states and both normalized storage definitions match the baseline.
  • Actual Opus 5.5 R-31 returns all 15 criteria met and no findings after reviewing the restored command coverage and prose correction. The live matrix ran at 9f4db43; later image-input changes are comments only, with identical parsed YAML.
  • CI passes at ecfce76. The complete lifecycle gate passes at that head.

The validation record preserves measurement limits and fixture failures. The Owner summary gives a short scope and proof overview.

Feature 0001 is complete without residuals. Merged after owner sign-off. Linked issues #1 and #3 are closed, and post-merge CI passes. Homelab guides remain draft.

Convert the Ubuntu template to the native hashicorp/proxmox proxmox-clone
builder alongside the existing qemu builder, selectable at invocation with
-only. Both share one build block and produce a generic, unidentified image.

- required_plugins: proxmox >= 1.2.2 + qemu ~> 1
- source proxmox-clone.ubuntu: clones a cloud-init base template, attaches an
  empty cloud-init drive (cloud_init + cloud_init_storage_pool), API-token auth,
  ends as a Proxmox template. No per-build qm importdisk.
- source qemu.ubuntu: portable qcow2, now arch-parameterized (amd64 default;
  arm64 for a fast HVF build on Apple Silicon).
- scripts/create-base-template.sh: Stage-0 one-time base-template bootstrap.
- install.sh trimmed to generic (waits for cloud-init); tooling deferred to #3.
- cleanup.sh seals the image: cloud-init clean, machine-id + dbus reset, remove
  SSH host keys and build authorized_keys.
- cloud-init seed stripped of identity (hostname vars) and amd64-only grub pkgs
  so it stays generic and arch-portable.
- secrets: token via PKR_VAR/untracked *.auto.pkrvars.hcl (+ .example); gitignore
  outputs and real vars files.
- remove orphaned scripts/.p10k.zsh + scripts/zshrc (zsh config returns via PDS in #3).

Tested locally: packer fmt clean, packer validate green (both builders), and a
full 'packer build -only=qemu.ubuntu' produced a sealed qcow2 (cleanup steps
verified in the build log). proxmox-clone verified statically; live PVE build is
phase-2 per spec 0002.

Refs #1
The baseline tooling that lives in Ubuntu's default apt repos belongs in the
cloud-init packages list (native apt integration), not deferred to PDS. Restore
git, net-tools, nmap, nfs-common, build-essential, zsh, btop alongside
qemu-guest-agent/curl/file. Only genuinely non-apt cases stay for PDS (#3): gh
(needs the cli.github.com repo) and neofetch (deprecated; goes with the MOTD).
grub-efi-amd64/shim-signed stay dropped (amd64-only, not needed for a cloud image).

Re-ran packer build -only=qemu.ubuntu: green (5m53s), all packages install
cleanly, image sealed as before.

Refs #1
@michielvha

Copy link
Copy Markdown
Contributor Author

Good catch on the package trimming, applied. Corrected the philosophy: apt-native packages stay in cloud-init (git, net-tools, nmap, nfs-common, build-essential, zsh, btop, curl, file, qemu-guest-agent), and only genuinely non-apt things defer to PDS (#3): gh (needs the cli.github.com repo) and neofetch (deprecated, rides along with the MOTD). grub-efi-amd64/shim-signed stay dropped (amd64-only, unnecessary for a cloud image).

Re-ran packer build -only=qemu.ubuntu: green in 5m53s, all packages install cleanly.

@michielvha michielvha changed the title Packer: native proxmox-clone builder + selectable qemu output (#1) Build generic Ubuntu images with off-node Proxmox bootstrap Nov 4, 2026
Include the nightly update and restricted SSH baseline, first-login Zi workflow,
and selectable MOTD presets in the combined Ubuntu image scope. Keep the wider
harness separate and link short READMEs to task guides. Acceptance remains pending.

Feature 0003 delivery is folded into feature 0001; its issue stays open.
vh-adlc gate superseded: pass (rules 1, docs 0e52f51)
vh-adlc gate planned: pass (rules 1, docs 0e52f51)
vh-adlc gate in-progress: pass (rules 1, docs 0e52f51)
vh-adlc gate in-progress: pass (rules 1, docs 0e52f51)
vh-adlc gate complete: pass (rules 1, docs 0e52f51)
@michielvha
michielvha merged commit fbf7929 into main Nov 6, 2026
1 check passed
@michielvha
michielvha deleted the feat/0001-packer-proxmox-native branch November 6, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spec 0003: Move provisioning into PDS (select and apply) Spec 0001: Customizable Ubuntu images with shared PDS recipes

1 participant