Repository navigation
common: make unattended upgrades actually run on every box - #36
Conversation
Cherry's images stopped unattended-upgrades on both groups, silently. Ubuntu (ipfs_nodes): the image ships /etc/apt/apt.conf.d/docker-disable-periodic-update with APT::Periodic::Enable "0". It sorts after 20auto-upgrades, so apt-daily and apt-daily-upgrade did nothing. Remove it, and assert afterwards via apt-config that periodic apt is on and Unattended-Upgrade is 1. Debian (indexers): Cherry's mirror rewrites Label:, so Debian's default label= patterns match nothing. Match the release, -security and -updates by origin and codename instead. needrestart in list-only mode moves from reboot_reporting.yml to every box, so the first unattended run on the IPFS boxes restarts nothing beyond packages' own postinst restarts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@claude review opus |
|
Claude review failed to run. See https://github.com/ipni/workers/actions/runs/43033577328 |
1 similar comment
|
Claude review failed to run. See https://github.com/ipni/workers/actions/runs/43033577328 |
TakGN
left a comment
There was a problem hiding this comment.
Reviewed at 1054476. I found two rollout issues that can affect security patching and one documentation error.
- [P2] Configure the restart policy before enabling periodic upgrades. The role removes the provider’s APT disable file before installing and configuring
needrestart. Ifapt-daily-upgrade.timerfires in that window, Ubuntu can restart services under its default policy. The same exposure persists if the play fails after deleting the file. Install the list-only configuration before enabling unattended upgrades. Task · Ubuntu restart behavior - [P2] Verify that package indexes refresh and the APT timers run. The new assertion still passes if a later drop-in sets
APT::Periodic::Update-Package-Liststo0, leaving scheduled upgrades on stale indexes, or if the systemd timers are inactive. Verify the effective refresh interval and that both APT timers are active and enabled. Assertion · APT scheduling documentation - [P3] Document Ubuntu’s inherited allowlist. The role inherits Ubuntu’s default allowlist, which includes
nobleand the ESM security origins alongsidenoble-security. Document the inherited allowlist so operators know which sources are eligible. README · Ubuntu default origins
I reviewed the diff directly. git diff --check, the local site.yml syntax check, and GitHub’s site-dry-run passed. The dry run skips the effective-settings assertion, so that check and live timer behavior remain unverified. GitHub dry run
Review on #36: - Install needrestart and its list-only setting before anything turns unattended upgrades on, so no run in between, and no failed play, leaves Ubuntu's restart-by-default policy in charge. - Keep apt-daily.timer and apt-daily-upgrade.timer enabled and running, and make the guard also require APT::Periodic::Update-Package-Lists "1", so upgrades never run on stale lists. - README: document Ubuntu's inherited allowlist (noble, noble-security and the ESM security origins, which apply only under Ubuntu Pro). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks. All three points are addressed in 882ce17:
Checks: yamllint is clean, ansible-lint passes (0 failures, 0 warnings, production profile), |
What was broken
roles/commonwrites20auto-upgradesand51-ipfs-unattended, but no managed box was installing security updates on its own. Found with read-only checks on 2026-11-11:ipfs_nodes (Ubuntu 24.04)
/etc/apt/apt.conf.d/docker-disable-periodic-updatewithAPT::Periodic::Enable "0". It belongs to no package and isn't in this repo. It sorts after20auto-upgradesand99*, so it wins.apt-dailyandapt-daily-upgradestart and exit at once,/var/log/unattended-upgrades/doesn't exist, and the package lists are weeks old. There is a sizeable backlog of-securityupgrades on each box.Origin: Ubuntu,Suite: noble-security, so Ubuntu's default-securitypattern matches. Only the Periodic switch is broken.i).indexers (Debian 13)
Label: debian trixie-security,Codename: trixie-security, and likewise fortrixieandtrixie-updates). Debian's defaults requirelabel=Debian/label=Debian-Security, so they match nothing. Only this repo's extraorigin=Debian,codename=${distro_codename}-updatespattern matched.What changes
Every managed box (
roles/common/tasks/main.yml)docker-disable-periodic-update. That's cleaner than an override file of ours that would have to sort afterdocker-*.$nrconf{restart} = 'l'(/etc/needrestart/conf.d/50-ipni.conf), moved out ofreboot_reporting.ymlso it applies everywhere. needrestart then lists services left on old libraries and restarts none of them.sshd -Tcheck. It runsapt-config shell enable APT::Periodic::Enable unattended APT::Periodic::Unattended-Upgradeand asserts thatenable='0'is absent andunattended='1'is present. It's skipped in check mode, because in CI's dry run the file hasn't really been removed yet.ipfs_nodes: the effect is the three changes above. Allowed origins are unchanged (Ubuntu's default,
-securityonly).indexers (
group_vars/indexers/main.yml): match by origin and codename, which hold on Cherry's mirror and on Debian's own:origin=Debian,codename=${distro_codename}origin=Debian,codename=${distro_codename}-securityorigin=Debian,codename=${distro_codename}-updatesBackports still don't match.
common_reboot_reportingnow only controls thenode_reboot_requiredmetric.README, "Package updates and reboots": the table covers both groups. It notes the two provider pitfalls, the new guard, and what the guard can't see: an origin pattern that matches nothing.
Rollout risk (please read before approving the real run)
site.ymlapplies from CI, one box at a time, after a required reviewer approves the dry run.Once applied, the next
apt-daily-upgradeon each box installs its whole backlog: dozens of packages on each Ubuntu box. CI applies one box at a time, but the runs finish minutes apart, so all three Ubuntu boxes may well upgrade the same morning.Recommendation: before merging, have an operator catch up each Ubuntu box by hand, one at a time, so the merge doesn't land a large backlog on all three at once:
/etc/needrestart/conf.d/50-ipni.confwith$nrconf{restart} = 'l';first):sudo apt-get update && sudo apt-get upgradeThe first unattended run after the merge then has little left to do.
Checks
python3 -m yamllint .: cleanpython3 -m ansiblelint:Passed: 0 failure(s), 0 warning(s) ... 'production'ansible-playbook --syntax-checkfor site, routing, bootstrap, content, k3s-upgrade, platform and cve: okscripts/render-manifests.ymlpluskubectl kustomizeon each rendered dir: ok (no manifest changes)Nothing has been run on the boxes.
🤖 Generated with Claude Code