fix: close OVA build gaps — 24.04, overlay copy, full compose stack

- Replace ubuntu-26.04 (unreleased) with ubuntu-24.04 LTS throughout
- Add file provisioner to Packer HCL to copy overlays/ into VM before
  provisioning (fixes missing zroc-setup binary in 03-setup-wizard.sh)
- Rebuild root docker-compose.yaml: full stack with env vars — Caddy,
  zroc-ui, Authentik (server + worker + postgres + redis), Prometheus,
  Grafana, Zerto exporter, Watchtower; no hardcoded credentials
- Add caddy/Caddyfile to repo root for reverse proxy / TLS
- Update 02-zroc.sh to pre-pull all service images during OVA build
- Update GitHub Actions workflow to reference ubuntu-2404.pkr.hcl

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Justin
2026-04-12 20:39:36 -04:00
parent fd9a5926c0
commit 450f50ddf4
8 changed files with 379 additions and 131 deletions
+4 -4
View File
@@ -31,7 +31,7 @@ jobs:
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=v$VERSION" >> $GITHUB_OUTPUT
echo "ova_name=zroc-appliance-${VERSION}-ubuntu-26.04-amd64.ova" >> $GITHUB_OUTPUT
echo "ova_name=zroc-appliance-${VERSION}-ubuntu-24.04-amd64.ova" >> $GITHUB_OUTPUT
- name: Install Packer
run: |
@@ -42,7 +42,7 @@ jobs:
- name: Packer init
working-directory: packer
run: packer init ubuntu-2604.pkr.hcl
run: packer init ubuntu-2404.pkr.hcl
- name: Validate
working-directory: packer
@@ -50,7 +50,7 @@ jobs:
packer validate \
-var "vm_version=${{ steps.ver.outputs.version }}" \
-var-file=variables.pkrvars.hcl \
ubuntu-2604.pkr.hcl
ubuntu-2404.pkr.hcl
- name: Build OVA
working-directory: packer
@@ -62,7 +62,7 @@ jobs:
-var "vm_version=${{ steps.ver.outputs.version }}" \
-var "headless=true" \
-var-file=variables.pkrvars.hcl \
ubuntu-2604.pkr.hcl
ubuntu-2404.pkr.hcl
- name: Locate OVA
id: ova
+2 -2
View File
@@ -1,11 +1,11 @@
# zroc-ova — zROC Appliance Builder
Packer build definitions and provisioner scripts for the **zROC Ubuntu 26.04 LTS OVA appliance**.
Packer build definitions and provisioner scripts for the **zROC Ubuntu 24.04 LTS OVA appliance**.
## What you get
A 100 GB thin-provisioned VMware OVA containing:
- Ubuntu Server 26.04 LTS
- Ubuntu Server 24.04 LTS
- Docker Engine + Compose plugin
- Full zROC stack (cloned from recklessop/zroc)
- Interactive first-boot setup wizard (`zroc-setup`)
@@ -14,12 +14,12 @@ packer {
variable "ubuntu_iso_url" {
type = string
default = "https://releases.ubuntu.com/26.04/ubuntu-26.04-live-server-amd64.iso"
default = "https://releases.ubuntu.com/24.04/ubuntu-24.04.2-live-server-amd64.iso"
}
variable "ubuntu_iso_checksum" {
type = string
default = "file:https://releases.ubuntu.com/26.04/SHA256SUMS"
default = "file:https://releases.ubuntu.com/24.04/SHA256SUMS"
}
variable "vm_name" {
@@ -57,46 +57,46 @@ variable "headless" {
default = true
}
source "vmware-iso" "ubuntu2604" {
vm_name = "${var.vm_name}-${var.vm_version}"
guest_os_type = "ubuntu-64"
headless = var.headless
iso_url = var.ubuntu_iso_url
iso_checksum = var.ubuntu_iso_checksum
disk_size = var.disk_size_mb
disk_adapter_type = "pvscsi"
memory = var.memory_mb
cpus = var.cpus
network_adapter_type = "vmxnet3"
network = "nat"
disk_type_id = 0
http_directory = "http"
http_port_min = 8100
http_port_max = 8199
boot_wait = "5s"
source "vmware-iso" "ubuntu2404" {
vm_name = "${var.vm_name}-${var.vm_version}"
guest_os_type = "ubuntu-64"
headless = var.headless
iso_url = var.ubuntu_iso_url
iso_checksum = var.ubuntu_iso_checksum
disk_size = var.disk_size_mb
disk_adapter_type = "pvscsi"
memory = var.memory_mb
cpus = var.cpus
network_adapter_type = "vmxnet3"
network = "nat"
disk_type_id = 0
http_directory = "http"
http_port_min = 8100
http_port_max = 8199
boot_wait = "5s"
boot_command = [
"e<wait>",
"<down><down><down><end>",
" autoinstall ds=nocloud-net;seedfrom=http://{{.HTTPIP}}:{{.HTTPPort}}/",
"<f10><wait30s>",
]
ssh_username = "zroc"
ssh_password = "zroc-setup-temp"
ssh_timeout = "30m"
ssh_port = 22
shutdown_command = "echo 'zroc-setup-temp' | sudo -S shutdown -P now"
output_directory = "${var.output_dir}/vmware"
skip_export = false
format = "ovf"
ssh_username = "zroc"
ssh_password = "zroc-setup-temp"
ssh_timeout = "30m"
ssh_port = 22
shutdown_command = "echo 'zroc-setup-temp' | sudo -S shutdown -P now"
output_directory = "${var.output_dir}/vmware"
skip_export = false
format = "ovf"
vmx_data = {
"virtualHW.version" = "19"
"tools.syncTime" = "TRUE"
"annotation" = "zROC Appliance v${var.vm_version}"
"guestOS" = "ubuntu-64"
"virtualHW.version" = "19"
"tools.syncTime" = "TRUE"
"annotation" = "zROC Appliance v${var.vm_version}"
"guestOS" = "ubuntu-64"
}
}
source "qemu" "ubuntu2604" {
source "qemu" "ubuntu2404" {
vm_name = "${var.vm_name}-${var.vm_version}"
iso_url = var.ubuntu_iso_url
iso_checksum = var.ubuntu_iso_checksum
@@ -109,7 +109,7 @@ source "qemu" "ubuntu2604" {
http_directory = "http"
http_port_min = 8100
http_port_max = 8199
boot_wait = "5s"
boot_wait = "5s"
boot_command = [
"e<wait>",
"<down><down><down><end>",
@@ -125,12 +125,18 @@ source "qemu" "ubuntu2604" {
}
build {
name = "zroc-appliance"
sources = ["source.vmware-iso.ubuntu2604"]
name = "zroc-appliance"
sources = ["source.vmware-iso.ubuntu2404"]
# Copy overlay files (setup wizard, etc.) into the VM before provisioning
provisioner "file" {
source = "../overlays/"
destination = "/tmp/overlays/"
}
provisioner "shell" {
script = "../scripts/00-base.sh"
execute_command = "echo 'zroc-setup-temp' | sudo -S bash {{.Path}}"
script = "../scripts/00-base.sh"
execute_command = "echo 'zroc-setup-temp' | sudo -S bash {{.Path}}"
expect_disconnect = true
}
@@ -161,12 +167,12 @@ build {
}
post-processor "shell-local" {
only = ["vmware-iso.ubuntu2604"]
only = ["vmware-iso.ubuntu2404"]
inline = [
"cd ${var.output_dir}/vmware",
"ovftool --compress=9 *.ovf ../${var.vm_name}-${var.vm_version}-ubuntu-26.04-amd64.ova",
"ovftool --compress=9 *.ovf ../${var.vm_name}-${var.vm_version}-ubuntu-24.04-amd64.ova",
"cd ..",
"sha256sum ${var.vm_name}-${var.vm_version}-ubuntu-26.04-amd64.ova > ${var.vm_name}-${var.vm_version}-ubuntu-26.04-amd64.ova.sha256",
"sha256sum ${var.vm_name}-${var.vm_version}-ubuntu-24.04-amd64.ova > ${var.vm_name}-${var.vm_version}-ubuntu-24.04-amd64.ova.sha256",
"echo 'OVA packaged successfully'",
]
}
+2 -2
View File
@@ -1,8 +1,8 @@
# zroc-ova/packer/variables.pkrvars.hcl
vm_version = "1.0.0"
ubuntu_iso_url = "https://releases.ubuntu.com/26.04/ubuntu-26.04-live-server-amd64.iso"
ubuntu_iso_checksum = "file:https://releases.ubuntu.com/26.04/SHA256SUMS"
ubuntu_iso_url = "https://releases.ubuntu.com/24.04/ubuntu-24.04.2-live-server-amd64.iso"
ubuntu_iso_checksum = "file:https://releases.ubuntu.com/24.04/SHA256SUMS"
memory_mb = 8192
cpus = 4
+18 -4
View File
@@ -8,15 +8,29 @@ ZROC_REPO="https://github.com/recklessop/zroc.git"
git clone --depth=1 "$ZROC_REPO" "$INSTALL_DIR"
# Ensure expected directories exist
mkdir -p \
"$INSTALL_DIR/certs" \
"$INSTALL_DIR/zvmexporter" \
"$INSTALL_DIR/certs" \
"$INSTALL_DIR/zvmexporter" \
"$INSTALL_DIR/data"
cd "$INSTALL_DIR"
docker compose pull prometheus grafana authentik-server authentik-worker \
|| echo "[02-zroc] Some images not yet available — will pull on first start"
# Pre-pull all container images into the OVA image layer so first-boot is fast.
# Failures are non-fatal — any missing images will be pulled on first docker compose up.
echo "==> [02-zroc] Pre-pulling container images (this may take a while)…"
docker compose pull \
caddy \
zroc-ui \
authentik-postgresql \
authentik-redis \
authentik-server \
authentik-worker \
zertoexporter \
zroc-prometheus \
grafana \
watchtower \
|| echo "[02-zroc] Warning: some images could not be pre-pulled — they will pull on first start"
chown -R zroc:zroc "$INSTALL_DIR"
+4 -1
View File
@@ -3,7 +3,10 @@
set -euo pipefail
echo "==> [03-setup-wizard] Installing setup wizard"
install -m 0755 /tmp/zroc-setup /usr/local/bin/zroc-setup
# The Packer file provisioner copies overlays/ to /tmp/overlays/
# Mirror the full directory tree into place
cp -r /tmp/overlays/usr /
chmod 0755 /usr/local/bin/zroc-setup
cat > /etc/systemd/system/zroc-firstboot.service << 'EOF'
[Unit]