system_baseline had no way to keep individual packages out of unattended-upgrades, for a host whose kernel or drivers must not change (for example one with hardware passthrough). New variable system_baseline_unattended_upgrade_package_blacklist (list of regular expressions, default []). A non-empty list is written to /etc/apt/apt.conf.d/90unattended-upgrades-blacklist as Unattended-Upgrade::Package-Blacklist { ... };; an empty list removes the file. apt appends list entries across files, so the entries are added to those of 50unattended-upgrades, which is not edited.
Design choice (the issue asked, no answer yet): a separate drop-in, like the existing 90unattended-upgrades-origins, instead of a block inside the distribution's 50unattended-upgrades conffile. The variable is flat (per host), not part of a profile. Entries may not hold a double quote, a backslash or a line break (the origins rule); the value must be a list of strings, so a bare string or a null item is refused (a bare string would otherwise be split into one-character patterns, a null would become an empty pattern).
Verified
The template renders, and apt-config parses the rendered file as a list (Unattended-Upgrade::Package-Blacklist:: "linux-image-.*"; and "nvidia-.*").
The validation, with Ansible's own engine: a list of normal patterns and an empty list pass; a double quote, a backslash, an empty string, a null item, an integer item, a bare string and a mapping are refused.
An independent review of the diff found two validation gaps (the bare string and the null item), fixed here and covered by the Molecule refusal cases.
The Molecule scenario adds: refusal of a quote, a null item and a bare string in converge; and in verify a play that writes a two-entry blacklist and checks apt-config dump, runs the tasks again and checks the file is not rewritten (checksum and mtime), then runs with an empty list and checks the file and the entries are gone.
Not verified
Molecule itself (CI only): the new refusal and verify cases have not run on the image.
unattended-upgrades acting on the blacklist on a real host. I checked how apt reads the file, not unattended-upgrades' own matching (the entries are regular expressions; whether they are matched from the start of the name or anywhere is why the README only says to anchor an entry that must not match longer names).
Like the other unattended-upgrades settings, the drop-in is only managed when unattended-upgrades is in the profile's packages (the README says so).
I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.
Assisted-by: Claude Code
## What and why
Closes #322
`system_baseline` had no way to keep individual packages out of unattended-upgrades, for a host whose kernel or drivers must not change (for example one with hardware passthrough). New variable `system_baseline_unattended_upgrade_package_blacklist` (list of regular expressions, default `[]`). A non-empty list is written to `/etc/apt/apt.conf.d/90unattended-upgrades-blacklist` as `Unattended-Upgrade::Package-Blacklist { ... };`; an empty list removes the file. apt appends list entries across files, so the entries are added to those of `50unattended-upgrades`, which is not edited.
Design choice (the issue asked, no answer yet): a separate drop-in, like the existing `90unattended-upgrades-origins`, instead of a block inside the distribution's `50unattended-upgrades` conffile. The variable is flat (per host), not part of a profile. Entries may not hold a double quote, a backslash or a line break (the origins rule); the value must be a list of strings, so a bare string or a `null` item is refused (a bare string would otherwise be split into one-character patterns, a `null` would become an empty pattern).
## Verified
- The template renders, and `apt-config` parses the rendered file as a list (`Unattended-Upgrade::Package-Blacklist:: "linux-image-.*";` and `"nvidia-.*"`).
- The validation, with Ansible's own engine: a list of normal patterns and an empty list pass; a double quote, a backslash, an empty string, a `null` item, an integer item, a bare string and a mapping are refused.
- All commit-stage hooks pass (yamllint, ansible-lint, REUSE, changelog lint, Conventional Commit).
- An independent review of the diff found two validation gaps (the bare string and the `null` item), fixed here and covered by the Molecule refusal cases.
- The Molecule scenario adds: refusal of a quote, a `null` item and a bare string in converge; and in verify a play that writes a two-entry blacklist and checks `apt-config dump`, runs the tasks again and checks the file is not rewritten (checksum and mtime), then runs with an empty list and checks the file and the entries are gone.
## Not verified
- Molecule itself (CI only): the new refusal and verify cases have not run on the image.
- `unattended-upgrades` acting on the blacklist on a real host. I checked how apt reads the file, not unattended-upgrades' own matching (the entries are regular expressions; whether they are matched from the start of the name or anywhere is why the README only says to anchor an entry that must not match longer names).
- Like the other unattended-upgrades settings, the drop-in is only managed when `unattended-upgrades` is in the profile's packages (the README says so).
---
- [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none.
Assisted-by: Claude Code
system_baseline_unattended_upgrade_package_blacklist (list of regular
expressions, default empty) is written to a drop-in as
Unattended-Upgrade::Package-Blacklist; an empty list removes it.
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.
What and why
Closes #322
system_baselinehad no way to keep individual packages out of unattended-upgrades, for a host whose kernel or drivers must not change (for example one with hardware passthrough). New variablesystem_baseline_unattended_upgrade_package_blacklist(list of regular expressions, default[]). A non-empty list is written to/etc/apt/apt.conf.d/90unattended-upgrades-blacklistasUnattended-Upgrade::Package-Blacklist { ... };; an empty list removes the file. apt appends list entries across files, so the entries are added to those of50unattended-upgrades, which is not edited.Design choice (the issue asked, no answer yet): a separate drop-in, like the existing
90unattended-upgrades-origins, instead of a block inside the distribution's50unattended-upgradesconffile. The variable is flat (per host), not part of a profile. Entries may not hold a double quote, a backslash or a line break (the origins rule); the value must be a list of strings, so a bare string or anullitem is refused (a bare string would otherwise be split into one-character patterns, anullwould become an empty pattern).Verified
apt-configparses the rendered file as a list (Unattended-Upgrade::Package-Blacklist:: "linux-image-.*";and"nvidia-.*").nullitem, an integer item, a bare string and a mapping are refused.nullitem), fixed here and covered by the Molecule refusal cases.nullitem and a bare string in converge; and in verify a play that writes a two-entry blacklist and checksapt-config dump, runs the tasks again and checks the file is not rewritten (checksum and mtime), then runs with an empty list and checks the file and the entries are gone.Not verified
unattended-upgradesacting on the blacklist on a real host. I checked how apt reads the file, not unattended-upgrades' own matching (the entries are regular expressions; whether they are matched from the start of the name or anywhere is why the README only says to anchor an entry that must not match longer names).unattended-upgradesis in the profile's packages (the README says so).NOTICEandREUSE.toml, or there is none.Assisted-by: Claude Code
New commits pushed, approval review dismissed automatically according to repository settings