capi: allow Ubuntu autoinstall mirror overrides - #2072
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
3a82447 to
55dcf5a
Compare
|
/test pull-azure-sigs I inspected the failed |
8de0a89 to
212b127
Compare
9bf6f67 to
155cf3d
Compare
|
/test pull-ova-all |
155cf3d to
1696113
Compare
|
/retest |
|
/label tide/merge-method-squash |
1696113 to
facb61e
Compare
facb61e to
2a14e85
Compare
2a14e85 to
aa608f1
Compare
|
/test pull-ova-all |
Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
set-ssh-password.sh only loaded common.json, PACKER_VAR_FILES, and PACKER_FLAGS when resolving ubuntu_repo/ubuntu_security_repo, so it missed overrides set in the target-specific var-file that the Makefile passes to Packer as the primary -var-file (e.g. build-maas-ubuntu-2404-arm64 -> packer/maas/maas-ubuntu-2404-arm64.json, which points both repos at ports.ubuntu.com). This caused the rendered autoinstall data to use a different mirror than what Packer actually builds with. Record each qemu/qemu-kubevirt/maas/maas-arm64/proxmox build and validate target's primary var-file in PACKER_TARGET_VAR_FILE and have the renderer load it right after common.json (still overridable by PACKER_VAR_FILES/PACKER_FLAGS), so the rendered data matches what Packer will use for that target. Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
aa608f1 to
1059357
Compare
mboersma
left a comment
There was a problem hiding this comment.
Could we rework the rendering so it is target-specific and follows the exact Packer variable precedence? The shared phony prerequisite currently runs only once, so aggregate or parallel builds can render every template using the wrong target’s mirrors. PACKER_FLAGS ordering can also disagree with Packer.
Please include the active 24.04 immutable template and avoid printing or retaining credential-bearing mirror URLs outside the selected build.
What this does
Ubuntu autoinstall user-data templates for QEMU, MAAS, and Proxmox currently hard-code the archive mirror used by the installer. This wires the existing
ubuntu_repoandubuntu_security_repovariables into those rendered templates so users can point the installer at a local mirror/cache before Ansible runs.The defaults still come from
packer/config/common.json, and callers can override them throughPACKER_FLAGS,PACKER_VAR_FILES,UBUNTU_REPO, orUBUNTU_SECURITY_REPO.Validation
bash -n images/capi/hack/set-ssh-password.shshellcheck -S warning images/capi/hack/set-ssh-password.shgit diff --checkubuntu_repo/ubuntu_security_repovaluesmake validate-qemu-ubuntu-2404 PACKER_FLAGS="--var 'ubuntu_repo=http://mirror.example.com/ubuntu' --var 'ubuntu_security_repo=http://security.example.com/ubuntu'"make validate-qemu-ubuntu-2404-efi PACKER_FLAGS="--var 'ubuntu_repo=http://mirror.example.com/ubuntu' --var 'ubuntu_security_repo=http://security.example.com/ubuntu'"make validate-maas-ubuntu-2404-efi PACKER_FLAGS="--var 'ubuntu_repo=http://mirror.example.com/ubuntu' --var 'ubuntu_security_repo=http://security.example.com/ubuntu'"I also ran
make validate-proxmox-ubuntu-2404with the same mirror flags. It rendered the template and reached Packer validation, then stopped on the expected local Proxmox provider inputs being unset (proxmox_url,node, credentials, storage pools, bridge, and ISO pool).