system_baseline can pin the origins unattended-upgrades may install from (system_baseline_unattended_upgrade_origins), but it has no way to keep individual packages out of unattended-upgrades. A host whose kernel and driver combination must not change (for example one with hardware passthrough, or a pinned kernel) has to be patched without those packages, and today the consumer has to write Unattended-Upgrade::Package-Blacklist into /etc/apt/apt.conf.d/ by hand. system_baseline_unattended_upgrade_settings writes one key "value"; line per entry, which cannot express the list form that Package-Blacklist takes (Package-Blacklist { "a"; "b"; };).
Out of scope: the origins pin, and the apt upgrade done by the role's own update flow (a separate matter).
Proposal
New variable system_baseline_unattended_upgrade_package_blacklist (list of strings, default []). A non-empty list is written to a block in /etc/apt/apt.conf.d/50unattended-upgrades (or a drop-in of its own, your choice) as Unattended-Upgrade::Package-Blacklist { "<pkg>"; ... };, with a marker so the block can be rewritten. Entries are regular expressions in unattended-upgrades, so the README says that.
Entries may not hold a double quote, a backslash or a line break (the same rule as the origins).
An empty list removes the block. Add it to meta/argument_specs.yml and the README variable table, and a minor_changes fragment.
Acceptance criteria
With a two-entry blacklist, apt-config dump in verify.yml shows both under Unattended-Upgrade::Package-Blacklist.
With an empty list the block is absent after a run that had it before (a second converge or a side_effect.yml run).
An entry with a double quote, backslash or line break is refused by argument_specs or a validation task, with a message that names the variable.
A second run changes nothing (Molecule idempotence).
ansible-test sanity, ansible-lint and yamllint are clean; README and changelog fragment updated.
Not verified
The exact rendering in your role: I have this as a blockinfile in my own role and it works there, but I have not written it against your task layout.
Whether unattended-upgrades --dry-run --debug (your validation task) accepts the block on Ubuntu 24.04. It does in my role.
Questions for the maintainer
A block in 50unattended-upgrades, or a separate drop-in like the origins file?
Is the variable name right?
Assisted-by: Claude Code
## Problem
`system_baseline` can pin the origins unattended-upgrades may install from (`system_baseline_unattended_upgrade_origins`), but it has no way to keep individual packages out of unattended-upgrades. A host whose kernel and driver combination must not change (for example one with hardware passthrough, or a pinned kernel) has to be patched without those packages, and today the consumer has to write `Unattended-Upgrade::Package-Blacklist` into `/etc/apt/apt.conf.d/` by hand. `system_baseline_unattended_upgrade_settings` writes one `key "value";` line per entry, which cannot express the list form that `Package-Blacklist` takes (`Package-Blacklist { "a"; "b"; };`).
Out of scope: the origins pin, and the apt upgrade done by the role's own `update` flow (a separate matter).
## Proposal
- New variable `system_baseline_unattended_upgrade_package_blacklist` (list of strings, default `[]`). A non-empty list is written to a block in `/etc/apt/apt.conf.d/50unattended-upgrades` (or a drop-in of its own, your choice) as `Unattended-Upgrade::Package-Blacklist { "<pkg>"; ... };`, with a marker so the block can be rewritten. Entries are regular expressions in unattended-upgrades, so the README says that.
- Entries may not hold a double quote, a backslash or a line break (the same rule as the origins).
- An empty list removes the block. Add it to `meta/argument_specs.yml` and the README variable table, and a `minor_changes` fragment.
## Acceptance criteria
- [ ] With a two-entry blacklist, `apt-config dump` in `verify.yml` shows both under `Unattended-Upgrade::Package-Blacklist`.
- [ ] With an empty list the block is absent after a run that had it before (a second converge or a `side_effect.yml` run).
- [ ] An entry with a double quote, backslash or line break is refused by `argument_specs` or a validation task, with a message that names the variable.
- [ ] A second run changes nothing (Molecule idempotence).
- [ ] `ansible-test sanity`, ansible-lint and yamllint are clean; README and changelog fragment updated.
## Not verified
- The exact rendering in your role: I have this as a `blockinfile` in my own role and it works there, but I have not written it against your task layout.
- Whether `unattended-upgrades --dry-run --debug` (your validation task) accepts the block on Ubuntu 24.04. It does in my role.
## Questions for the maintainer
- A block in `50unattended-upgrades`, or a separate drop-in like the origins file?
- Is the variable name right?
Assisted-by: Claude Code
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
system_baselinecan pin the origins unattended-upgrades may install from (system_baseline_unattended_upgrade_origins), but it has no way to keep individual packages out of unattended-upgrades. A host whose kernel and driver combination must not change (for example one with hardware passthrough, or a pinned kernel) has to be patched without those packages, and today the consumer has to writeUnattended-Upgrade::Package-Blacklistinto/etc/apt/apt.conf.d/by hand.system_baseline_unattended_upgrade_settingswrites onekey "value";line per entry, which cannot express the list form thatPackage-Blacklisttakes (Package-Blacklist { "a"; "b"; };).Out of scope: the origins pin, and the apt upgrade done by the role's own
updateflow (a separate matter).Proposal
system_baseline_unattended_upgrade_package_blacklist(list of strings, default[]). A non-empty list is written to a block in/etc/apt/apt.conf.d/50unattended-upgrades(or a drop-in of its own, your choice) asUnattended-Upgrade::Package-Blacklist { "<pkg>"; ... };, with a marker so the block can be rewritten. Entries are regular expressions in unattended-upgrades, so the README says that.meta/argument_specs.ymland the README variable table, and aminor_changesfragment.Acceptance criteria
apt-config dumpinverify.ymlshows both underUnattended-Upgrade::Package-Blacklist.side_effect.ymlrun).argument_specsor a validation task, with a message that names the variable.ansible-test sanity, ansible-lint and yamllint are clean; README and changelog fragment updated.Not verified
blockinfilein my own role and it works there, but I have not written it against your task layout.unattended-upgrades --dry-run --debug(your validation task) accepts the block on Ubuntu 24.04. It does in my role.Questions for the maintainer
50unattended-upgrades, or a separate drop-in like the origins file?Assisted-by: Claude Code