system_baseline_essential_packages and system_baseline_remove_packages replace the profile's whole list, and so does a list inside system_baseline_profile_overrides. Adding one package meant repeating the profile's list and keeping it in step with every release.
This adds system_baseline_extra_packages and system_baseline_extra_remove_packages (lists of str, default []), which append to the resolved lists:
tasks/packages.yml installs the resolved list plus the extras and purges the resolved remove list plus the extra removals, without duplicates. Two internal defaults, __system_baseline_install_packages and __system_baseline_purge_packages, hold the combined lists.
The two checks that test the package list read the combined list, so an extra tmux enables the tmux snippet and an extra unattended-upgrades enables the unattended-upgrades tasks, as a profile package does.
tasks/validate.yml refuses, before any change, an item that is not a Debian package name and a package that one input installs and another purges. Only overlaps that involve an extra are checked, so a consumer's own overlap between the resolved lists behaves as before.
argument_specs, README (table, a section "Adding packages to a profile", the tmux note, the Tests list) and a minor_changes fragment.
With both inputs at their default the role behaves as before (the resolved lists of all three profiles pass through unique unchanged: none has a duplicate).
Beyond the proposal in the issue, three decisions you may want to look at:
Package-name check. The issue says "list of str". The role refuses an item that is not a Debian package name (^[a-z0-9][a-z0-9+.-]*[a-z0-9+.]$): jq- would otherwise reach apt as "remove jq", a null item would become the package None, and a version pin or a glob is out of scope. If you want it looser, it is one regex in tasks/validate.yml.
pve and tmux. An extra tmux on the pve profile with system_baseline_tmux_autostart: true now installs the snippet, which the README said never happened. It is a double opt-in (autostart defaults to false) and is the same as a flat package list with tmux in it today. The README and the spec now say so; there is no pve refusal.
A flat string.system_baseline_essential_packages: vim (the package module accepts a string) counts as a one-item list instead of failing on the new +.
The scenario's pure plays, run on localhost with ansible-core 2.22.0 in check mode against this branch: 11 refusal cases (8 bad items, 3 overlaps) each stop with the expected message, and the profile-resolution plays, the "extras append" play and the flat-string play pass (ok=214 failed=0 rescued=14; the 14 rescued are these 11 and the 3 existing blacklist cases).
With the overlap check removed from a copy, the same plays fail at the first overlap case, so the refusal tests do bite.
An independent read-only review found the sweep of readers complete, the entry points update and reboot untouched, and the Found: [...] message rendering; its findings (the flat string, three stale README/spec/defaults statements, the loose item pattern) are fixed in this commit.
Not verified
Molecule: it runs only in CI. In particular nothing here proves that jq is installed and ed is purged on both images. prepare.yml makes jq absent and ed present first, so the effect is the role's. ed is a guess for a package on no profile list that is safe to purge on noble and resolute; if the first run shows a dependency on it, the test needs another package.
An extra unattended-upgrades is only asserted at the list level (__system_baseline_install_packages), not by running the unattended-upgrades tasks; the tmux gate is run for real.
Behaviour on an ansible-core older than the pinned 2.22.
I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none. (None.)
Assisted-by: Claude Code:claude-sonnet-5-5
## What and why
Closes #399
`system_baseline_essential_packages` and `system_baseline_remove_packages` replace the profile's whole list, and so does a list inside `system_baseline_profile_overrides`. Adding one package meant repeating the profile's list and keeping it in step with every release.
This adds `system_baseline_extra_packages` and `system_baseline_extra_remove_packages` (lists of str, default `[]`), which append to the resolved lists:
- `tasks/packages.yml` installs the resolved list plus the extras and purges the resolved remove list plus the extra removals, without duplicates. Two internal defaults, `__system_baseline_install_packages` and `__system_baseline_purge_packages`, hold the combined lists.
- The two checks that test the package list read the combined list, so an extra `tmux` enables the tmux snippet and an extra `unattended-upgrades` enables the unattended-upgrades tasks, as a profile package does.
- `tasks/validate.yml` refuses, before any change, an item that is not a Debian package name and a package that one input installs and another purges. Only overlaps that involve an extra are checked, so a consumer's own overlap between the resolved lists behaves as before.
- argument_specs, README (table, a section "Adding packages to a profile", the tmux note, the Tests list) and a `minor_changes` fragment.
With both inputs at their default the role behaves as before (the resolved lists of all three profiles pass through `unique` unchanged: none has a duplicate).
Beyond the proposal in the issue, three decisions you may want to look at:
- **Package-name check.** The issue says "list of str". The role refuses an item that is not a Debian package name (`^[a-z0-9][a-z0-9+.-]*[a-z0-9+.]$`): `jq-` would otherwise reach apt as "remove jq", a null item would become the package `None`, and a version pin or a glob is out of scope. If you want it looser, it is one regex in `tasks/validate.yml`.
- **`pve` and tmux.** An extra `tmux` on the `pve` profile with `system_baseline_tmux_autostart: true` now installs the snippet, which the README said never happened. It is a double opt-in (autostart defaults to false) and is the same as a flat package list with `tmux` in it today. The README and the spec now say so; there is no `pve` refusal.
- **A flat string.** `system_baseline_essential_packages: vim` (the package module accepts a string) counts as a one-item list instead of failing on the new `+`.
## Verified
- All commit-stage hooks passed locally (ansible-lint, yamllint, changelog fragments lint, REUSE, Conventional Commit, `Assisted-by`).
- The scenario's pure plays, run on localhost with ansible-core 2.22.0 in check mode against this branch: 11 refusal cases (8 bad items, 3 overlaps) each stop with the expected message, and the profile-resolution plays, the "extras append" play and the flat-string play pass (`ok=214 failed=0 rescued=14`; the 14 rescued are these 11 and the 3 existing blacklist cases).
- With the overlap check removed from a copy, the same plays fail at the first overlap case, so the refusal tests do bite.
- An independent read-only review found the sweep of readers complete, the entry points `update` and `reboot` untouched, and the `Found: [...]` message rendering; its findings (the flat string, three stale README/spec/defaults statements, the loose item pattern) are fixed in this commit.
## Not verified
- Molecule: it runs only in CI. In particular nothing here proves that `jq` is installed and `ed` is purged on both images. `prepare.yml` makes `jq` absent and `ed` present first, so the effect is the role's. `ed` is a guess for a package on no profile list that is safe to purge on noble and resolute; if the first run shows a dependency on it, the test needs another package.
- An extra `unattended-upgrades` is only asserted at the list level (`__system_baseline_install_packages`), not by running the unattended-upgrades tasks; the tmux gate is run for real.
- Behaviour on an `ansible-core` older than the pinned 2.22.
---
- [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none. (None.)
Assisted-by: Claude Code:claude-sonnet-5-5
system_baseline_essential_packages and system_baseline_remove_packages
replace the whole list, and so does a list inside
system_baseline_profile_overrides, so adding one package meant repeating
the profile's list and keeping it in step with every release.
system_baseline_extra_packages and system_baseline_extra_remove_packages
(lists, default empty) append to the resolved lists. The tmux and
unattended-upgrades checks read the combined list, so an extra tmux or
unattended-upgrades enables the matching task like a profile package.
Items must be Debian package names: a null item would have become the
package "None", and apt reads a trailing minus (jq-) as a removal. A
package that one input installs and another purges stops the run before
any change; only overlaps that involve an extra are checked, so a
consumer's own overlap between the resolved lists behaves as before. A
flat input that is a plain string still counts as a one-item list.
With both inputs left at their default the role behaves as before.
Closes#399
Assisted-by: Claude Code:claude-sonnet-5-5
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 #399
system_baseline_essential_packagesandsystem_baseline_remove_packagesreplace the profile's whole list, and so does a list insidesystem_baseline_profile_overrides. Adding one package meant repeating the profile's list and keeping it in step with every release.This adds
system_baseline_extra_packagesandsystem_baseline_extra_remove_packages(lists of str, default[]), which append to the resolved lists:tasks/packages.ymlinstalls the resolved list plus the extras and purges the resolved remove list plus the extra removals, without duplicates. Two internal defaults,__system_baseline_install_packagesand__system_baseline_purge_packages, hold the combined lists.tmuxenables the tmux snippet and an extraunattended-upgradesenables the unattended-upgrades tasks, as a profile package does.tasks/validate.ymlrefuses, before any change, an item that is not a Debian package name and a package that one input installs and another purges. Only overlaps that involve an extra are checked, so a consumer's own overlap between the resolved lists behaves as before.minor_changesfragment.With both inputs at their default the role behaves as before (the resolved lists of all three profiles pass through
uniqueunchanged: none has a duplicate).Beyond the proposal in the issue, three decisions you may want to look at:
^[a-z0-9][a-z0-9+.-]*[a-z0-9+.]$):jq-would otherwise reach apt as "remove jq", a null item would become the packageNone, and a version pin or a glob is out of scope. If you want it looser, it is one regex intasks/validate.yml.pveand tmux. An extratmuxon thepveprofile withsystem_baseline_tmux_autostart: truenow installs the snippet, which the README said never happened. It is a double opt-in (autostart defaults to false) and is the same as a flat package list withtmuxin it today. The README and the spec now say so; there is nopverefusal.system_baseline_essential_packages: vim(the package module accepts a string) counts as a one-item list instead of failing on the new+.Verified
Assisted-by).ok=214 failed=0 rescued=14; the 14 rescued are these 11 and the 3 existing blacklist cases).updateandrebootuntouched, and theFound: [...]message rendering; its findings (the flat string, three stale README/spec/defaults statements, the loose item pattern) are fixed in this commit.Not verified
jqis installed andedis purged on both images.prepare.ymlmakesjqabsent andedpresent first, so the effect is the role's.edis a guess for a package on no profile list that is safe to purge on noble and resolute; if the first run shows a dependency on it, the test needs another package.unattended-upgradesis only asserted at the list level (__system_baseline_install_packages), not by running the unattended-upgrades tasks; the tmux gate is run for real.ansible-coreolder than the pinned 2.22.NOTICEandREUSE.toml, or there is none. (None.)Assisted-by: Claude Code:claude-sonnet-5-5