feat(system_baseline): add an update toggle and pin the pve unattended-upgrades origins #142

Merged
Defame1297 merged 3 commits from feat/system-baseline-update-toggle into main 2026-11-15 07:16:33 +00:00
Owner

For a consumer that stops patching Proxmox nodes from its provisioning chain and moves patching to an operator-run playbook (full upgrade and rolling reboot). Unattended-upgrades stays on for the nodes, limited to Debian.

Changes

  • system_baseline_update (bool, default true, so nothing changes by default). With false, the main flow skips tasks/update.yml. The tasks_from: update entry point does not read it, because calling that entry point is an explicit request to update. The reboot check still runs, so a host whose patch flow owns the reboot also sets system_baseline_reboot_if_required: false. This is documented in the README and argument_specs.
  • Profile key unattended_upgrade_origins, resolved as system_baseline_unattended_upgrade_origins (| default([]), so a system_baseline_profiles written without the key still works):
    • With a non-empty list, the role writes /etc/apt/apt.conf.d/90unattended-upgrades-origins. That file runs #clear Unattended-Upgrade::Allowed-Origins; and #clear Unattended-Upgrade::Origins-Pattern;, then sets only the listed patterns.
    • An empty list removes the file.
    • Why #clear: apt appends list entries across apt.conf.d files, so a drop-in that only lists origins would add to Debian's 50unattended-upgrades and could never narrow it. The role does not edit the origin lists in 50unattended-upgrades either. A file that sorts after 90 could still add origins, and the README says so.
    • pve pins exactly Debian 13's default set: origin=Debian,codename=${distro_codename},label=Debian, ...label=Debian-Security and origin=Debian,codename=${distro_codename}-security,label=Debian-Security. The Proxmox repository is never included.
    • ubuntu_lxc and ubuntu_vm get [], so they are unchanged.
    • validate.yml refuses an entry that is not a list of non-empty one-line strings, or that holds a double quote or a backslash. Either would break out of the quoted apt.conf string.
  • argument_specs, README and a minor_changes fragment are updated. There is no galaxy.yml bump; the release is a separate PR.
  • Molecule:
    • converge asserts the resolved pve origins (three entries, none mention Proxmox), the system_baseline_update default and [] for ubuntu_vm.
    • verify runs tasks_from: unattended_upgrades with the pve profile on the Ubuntu container and checks apt-config dump. Only the three patterns may remain, and there must be no Allowed-Origins entries. Ubuntu's own file sets Allowed-Origins, so passing shows that #clear removes the earlier entries. verify then switches back to ubuntu_lxc and checks that the drop-in is gone and Ubuntu's origins are back.

Verified

  • All commit hooks pass (yamllint, ansible-lint, REUSE, changelog lint, gitleaks, Conventional Commits). The pre-push ansible-test sanity passes too.
  • A scratch play on localhost only (no hosts touched):
    • The pve and ubuntu_vm profiles resolve as expected.
    • The validation refuses a"b, a\b, a newline, an empty string, a bare string, a non-string entry and a list with one bad entry. It accepts the pve defaults and [].
    • The template renders as intended.
  • apt-config dump against a scratch config dir: with a 50unattended-upgrades holding Proxmox entries in both lists, the rendered drop-in leaves exactly the three Debian patterns and no Allowed-Origins entries. Without the drop-in, the Proxmox entries remain.

Not verified

  • Molecule did not run locally (there is no container runtime). The new verify play runs in CI only.
  • The system_baseline_update: false skip has no behavioural test, because the scenario already skips the update tag. Only its default is asserted.
  • Nothing was run against a real Proxmox node. Running unattended-upgrades --dry-run --debug on a node after the role runs is the live check.

🤖 Generated with Claude Code

For a consumer that stops patching Proxmox nodes from its provisioning chain and moves patching to an operator-run playbook (full upgrade and rolling reboot). Unattended-upgrades stays on for the nodes, limited to Debian. ## Changes - **`system_baseline_update`** (bool, default `true`, so nothing changes by default). With `false`, the main flow skips `tasks/update.yml`. The `tasks_from: update` entry point does **not** read it, because calling that entry point is an explicit request to update. The reboot check still runs, so a host whose patch flow owns the reboot also sets `system_baseline_reboot_if_required: false`. This is documented in the README and argument_specs. - **Profile key `unattended_upgrade_origins`**, resolved as `system_baseline_unattended_upgrade_origins` (`| default([])`, so a `system_baseline_profiles` written without the key still works): - With a non-empty list, the role writes `/etc/apt/apt.conf.d/90unattended-upgrades-origins`. That file runs `#clear Unattended-Upgrade::Allowed-Origins;` and `#clear Unattended-Upgrade::Origins-Pattern;`, then sets only the listed patterns. - An empty list removes the file. - Why `#clear`: apt appends list entries across `apt.conf.d` files, so a drop-in that only lists origins would add to Debian's `50unattended-upgrades` and could never narrow it. The role does not edit the origin lists in `50unattended-upgrades` either. A file that sorts after `90` could still add origins, and the README says so. - `pve` pins exactly Debian 13's default set: `origin=Debian,codename=${distro_codename},label=Debian`, `...label=Debian-Security` and `origin=Debian,codename=${distro_codename}-security,label=Debian-Security`. The Proxmox repository is never included. - `ubuntu_lxc` and `ubuntu_vm` get `[]`, so they are unchanged. - `validate.yml` refuses an entry that is not a list of non-empty one-line strings, or that holds a double quote or a backslash. Either would break out of the quoted apt.conf string. - argument_specs, README and a `minor_changes` fragment are updated. There is no `galaxy.yml` bump; the release is a separate PR. - Molecule: - converge asserts the resolved pve origins (three entries, none mention Proxmox), the `system_baseline_update` default and `[]` for ubuntu_vm. - verify runs `tasks_from: unattended_upgrades` with the pve profile on the Ubuntu container and checks `apt-config dump`. Only the three patterns may remain, and there must be no `Allowed-Origins` entries. Ubuntu's own file sets `Allowed-Origins`, so passing shows that `#clear` removes the earlier entries. verify then switches back to ubuntu_lxc and checks that the drop-in is gone and Ubuntu's origins are back. ## Verified - All commit hooks pass (yamllint, ansible-lint, REUSE, changelog lint, gitleaks, Conventional Commits). The pre-push `ansible-test sanity` passes too. - A scratch play on localhost only (no hosts touched): - The pve and ubuntu_vm profiles resolve as expected. - The validation refuses `a"b`, `a\b`, a newline, an empty string, a bare string, a non-string entry and a list with one bad entry. It accepts the pve defaults and `[]`. - The template renders as intended. - `apt-config dump` against a scratch config dir: with a `50unattended-upgrades` holding Proxmox entries in both lists, the rendered drop-in leaves exactly the three Debian patterns and no `Allowed-Origins` entries. Without the drop-in, the Proxmox entries remain. ## Not verified - Molecule did not run locally (there is no container runtime). The new verify play runs in CI only. - The `system_baseline_update: false` skip has no behavioural test, because the scenario already skips the `update` tag. Only its default is asserted. - Nothing was run against a real Proxmox node. Running `unattended-upgrades --dry-run --debug` on a node after the role runs is the live check. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Claude added 1 commit 2026-11-14 22:12:55 +00:00
feat(system_baseline): add an update toggle and pin the pve unattended-upgrades origins
Build / build (pull_request) Successful in 11s
Lint / lint (pull_request) Successful in 35s
Molecule / molecule (pull_request) Successful in 1m46s
52d06204bb
system_baseline_update (default true) lets the main flow skip the package
update for hosts patched by a separate, operator-run flow. The update entry
point does not read it: calling it is the request to update.

The new profile key unattended_upgrade_origins is rendered into
/etc/apt/apt.conf.d/90unattended-upgrades-origins, which #clears both
origin lists before setting the pinned patterns, because apt appends list
entries across files and a plain drop-in could only widen them. The pve
profile pins Debian's point-release and security origins, never the
Proxmox repository; the ubuntu profiles pin nothing and are unchanged.

Refs defame1297/ansible-homelab-mono#349

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
Defame1297 added 1 commit 2026-11-14 22:25:01 +00:00
fix(system_baseline): refuse a mapping as origins and document the pin's reach
Build / build (pull_request) Successful in 11s
Lint / lint (pull_request) Successful in 34s
Molecule / molecule (pull_request) Successful in 1m43s
4d02dbbe60
The origins check now refuses a dict, which Jinja's sequence test accepts.
The changelog states that the pve drop-in drops origins added in earlier
apt.conf.d files and names the opt-out; the README and the drop-in header
note that /etc/apt/apt.conf, read after apt.conf.d, can still add origins;
the verify play notes that the pve run rewrites the 50unattended-upgrades
keys and the ubuntu_lxc re-run restores them.

Refs defame1297/ansible-homelab-mono#349

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
Defame1297 added 1 commit 2026-11-15 07:13:57 +00:00
Merge branch 'main' into feat/system-baseline-update-toggle
Build / build (pull_request) Successful in 11s
Lint / lint (pull_request) Successful in 36s
Molecule / molecule (pull_request) Successful in 1m46s
5655a37bbd
Defame1297 scheduled this pull request to auto merge when all checks succeed 2026-11-15 07:16:13 +00:00
Defame1297 merged commit d1abdc7c3a into main 2026-11-15 07:16:33 +00:00
Defame1297 deleted branch feat/system-baseline-update-toggle 2026-11-15 07:16:33 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#142