Repository navigation
feat(packer): build 901 without networking in its initramfs - #1569
Merged
Merged
Conversation
Every clone of template 901 asked the lab's DHCP server for an address from its dracut initramfs before its static address applied; eden leased from the pool at each boot. The Ubuntu build now omits net-lib and systemd-networkd from every initramfs and fails if one survives, the smoke test fails a clone that DHCPs before switch-root, and eden's runbook carries the step for clones of an older 901. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-initramfs-network # Conflicts: # docs/changelog.md
There was a problem hiding this comment.
🟡 Changes recommended
The initramfs check can silently accept an lsinitrd failure, allowing the build to report success without verifying that networking is absent.
1 open issue
What changed in this PR
This PR updates Ubuntu template 901 to prevent clones from requesting DHCP leases during early boot, before their configured networking takes effect. The template still needs rebuilding; eden has received the fix manually.
Changes:
- Add a post-upgrade provisioner that removes initramfs networking, rebuilds images, and checks their modules.
- Extend Linux smoke checks to detect DHCP before switch-root and report unreadable journals as skipped.
- Document remediation for older clones and record the changes.
| File | Description |
|---|---|
scripts/packer-smoke.sh |
Checks Linux boot journals for early DHCP. |
packer/ubuntu/no-initramfs-network.sh |
Disables initramfs networking and rebuilds and inspects images. |
packer/ubuntu.pkr.hcl |
Runs the new provisioner after upgrading Ubuntu. |
docs/runbooks/build-the-lab-templates.md |
Describes the provisioner and expanded smoke checks. |
docs/runbooks/build-the-bloodhound-guest.md |
Adds older-clone remediation, verification, and rollback steps. |
docs/changelog.md |
Records the template change and manual fix on eden. |
Review effort: Balanced
In `if lsinitrd | grep -q`, the status is grep's and set -e does not apply, so a failed lsinitrd read as an image without networking. Read the module list first and fail if lsinitrd errors or lists nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gerrrt
enabled auto-merge (squash)
November 18, 2026 05:24
Gerrrt
added a commit
that referenced
this pull request
Nov 18, 2026
Under set -e a failed x="$(ssh … 2>/dev/null)" ended the script with nothing printed. The packer-user, early-DHCP and Panther checks now go through ssh_run, which prints ssh's stderr and the exit status before it dies. Refs #1569 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gerrrt
added a commit
that referenced
this pull request
Nov 18, 2026
…ker user (#1571) * docs(lab): record template 901 rebuilt; smoke-test for a leftover packer user 901 was rebuilt with no-initramfs-network.sh and packer-smoke.sh 901 passed, no DHCP before switch-root included. The rebuild's userdel printed a busy warning that -f goes past, but `|| true` would hide a failed delete, so the smoke test now fails a Linux clone that still has a packer user. Refs #1569 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(smoke): say why when an SSH check fails, not stop silently Under set -e a failed x="$(ssh … 2>/dev/null)" ended the script with nothing printed. The packer-user, early-DHCP and Panther checks now go through ssh_run, which prints ssh's stderr and the exit status before it dies. Refs #1569 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What changed
Template
901's build now leaves networking out of every initramfs, so its clones stop asking the lab's DHCP server for an address while they boot.eden, a clone of the old901, has the fix applied by hand.packer/ubuntu/no-initramfs-network.sh: a new provisioner that runs after the upgrade. It writes the dracut drop-in the hand-installed guests carry (omit_dracutmodules+=" net-lib systemd-networkd "), rebuilds every kernel's initramfs, and fails the build iflsinitrd -mstill showsnet-liborsystemd-networkd.scripts/packer-smoke.sh: a Linux clone fails if its journal shows DHCP before switch-root. A family with no systemd initramfs passes as having nothing to check. One whosesmokeuser can't read the journal withsudo -nis printed as SKIP, not PASS.docs/runbooks/build-the-bloodhound-guest.md§2: the step for a clone of an older901. The proof readseth0, which is what the running system calls the NIC the initramfs callsens18.docs/runbooks/build-the-lab-templates.md: the Ubuntu build description and §6's smoke test now mention both.docs/changelog.md: a 2026-11-18 entry.Why
edenwas the one 26.04 guest not read for the lab-pool question, because it was off. Its journal shows the initramfs leasing.106on both boots of 2026-11-16 and.101at 05:10 UTC today. It's a clone of901, not an ISO install, so the cause is in the template.Blast radius
The template: the next
901build. A wrong rebuild fails the build itself, and the smoke test catches a clone that still DHCPs.eden: already applied, proved and running. If a lateredeninitramfs fails to boot, the runbook's GRUB fallback applies.Other templates: the smoke change touches every Linux family. Where the clone has no systemd initramfs it passes as nothing to check; where the journal can't be read it is printed as SKIP.
No change to network segmentation or firewall rules
No new port published to a VLAN that could not already reach the service
No credential added outside
secrets/*.sops.yamlVerification
eden, applied by this session (passwordless sudo):dyn-netconfline.0, no networkd before switch-root, andeth0held only10.0.30.41/24./srv/bloodhound-datamounted, all five BloodHound containers back.The new smoke check: its remote command, run against
edenbefore the fix, printed2, so the check can fail.Not run:
901is not rebuilt yet; that'sbuild-the-lab-templates.md§8.packer validate,packer fmtandzizmor: there's no localpackeror Docker daemon. CI's lint runs them.Local checks:
python3 scripts/check_docs.py→docs OK — 164 Prometheus + 21 Loki rules, 8 dashboards, 156 panels, 14 assertions.ansible-lintfails in its local runner, as on main; no Ansible touched.make validatepasses (CI)Deployed to the lab and confirmed working (
edenyes; template901not rebuilt yet)Docs updated (
docs/, service README, ordocs/roadmap.md)🤖 Generated with Claude Code