system_baseline caps the persistent journal on every host (SystemMaxUse, default 200M) with no way to opt out. A consumer who manages journald elsewhere (a different drop-in, a host with its own size policy, a host whose cap is set by another role) can only set a value that happens to match theirs, and the role still writes its own drop-in and restarts systemd-journald when it changes. Setting the input to an empty string today writes SystemMaxUse= (an empty assignment) rather than leaving the host alone, and any other bad value (0, a bare 300, a typo) is written unchecked.
Out of scope: other journald settings, removing a drop-in that an earlier run wrote, changing the 200M default.
Proposal
Treat an empty system_baseline_journal_max_use as "do not manage", exactly as system_baseline_apt_daily_timeout does:
In tasks/main.yml add when: system_baseline_journal_max_use | length > 0 to the journald import (the apt-daily import uses when: system_baseline_apt_daily_timeout | length > 0). With an empty value neither the drop-in directory, the drop-in file nor the journald restart handler runs.
Add an assert to tasks/validate.yml in the style of the apt-daily one: the value is a string and is either empty or matches a one-line size pattern (a number followed by K, M, G or T, optionally infinity), so a bare integer or a value with a newline is refused before any change. The exact pattern is the maintainer's call; the principle is that a value written into a unit-style file is checked as the apt-daily value is.
argument_specs.yml: keep type: str, default: 200M, and add the sentence "Empty leaves the host alone; clearing the value later does not remove a file already written."
The default stays 200M, so a consumer who does not set it sees no change.
Question for the maintainer: should an empty value also remove a drop-in a previous run wrote? The apt-daily input deliberately does not, and this proposal matches it.
Acceptance criteria
With the default, the role writes /etc/systemd/journald.conf.d/50-system-baseline.conf with SystemMaxUse=200M, as in v3.0.0. Check: molecule verify's existing journal-cap assertion.
With system_baseline_journal_max_use: "", the role creates no drop-in directory or file and does not notify Restart systemd-journald. Check: a molecule scenario that sets it and asserts the file does not exist on a fresh instance.
With a value that is not empty and not a size (300, 0, 10 M, a value with a line break), the run stops before any change with a message that names the input. Check: a "refuse" scenario in the style of refuse_reboot.yml.
The spec entry and README row say that empty leaves the host alone and that clearing the value later removes nothing. Check: ansible-doc -t role mortis.kamino.system_baseline; review.
A minor_changes fragment exists. Check: pre-commit run --all-files.
This is the contributor's own code and is offered under GPL-3.0-or-later, the Collection's licence.
Assisted-by: Claude Code
## Problem
`system_baseline` caps the persistent journal on every host (`SystemMaxUse`, default `200M`) with no way to opt out. A consumer who manages journald elsewhere (a different drop-in, a host with its own size policy, a host whose cap is set by another role) can only set a value that happens to match theirs, and the role still writes its own drop-in and restarts `systemd-journald` when it changes. Setting the input to an empty string today writes `SystemMaxUse=` (an empty assignment) rather than leaving the host alone, and any other bad value (`0`, a bare `300`, a typo) is written unchecked.
Out of scope: other journald settings, removing a drop-in that an earlier run wrote, changing the `200M` default.
## Proposal
Treat an empty `system_baseline_journal_max_use` as "do not manage", exactly as `system_baseline_apt_daily_timeout` does:
- In `tasks/main.yml` add `when: system_baseline_journal_max_use | length > 0` to the journald import (the apt-daily import uses `when: system_baseline_apt_daily_timeout | length > 0`). With an empty value neither the drop-in directory, the drop-in file nor the journald restart handler runs.
- Add an assert to `tasks/validate.yml` in the style of the apt-daily one: the value is a string and is either empty or matches a one-line size pattern (a number followed by `K`, `M`, `G` or `T`, optionally `infinity`), so a bare integer or a value with a newline is refused before any change. The exact pattern is the maintainer's call; the principle is that a value written into a unit-style file is checked as the apt-daily value is.
- `argument_specs.yml`: keep `type: str`, `default: 200M`, and add the sentence "Empty leaves the host alone; clearing the value later does not remove a file already written."
The default stays `200M`, so a consumer who does not set it sees no change.
Question for the maintainer: should an empty value also remove a drop-in a previous run wrote? The apt-daily input deliberately does not, and this proposal matches it.
## Acceptance criteria
- [ ] With the default, the role writes `/etc/systemd/journald.conf.d/50-system-baseline.conf` with `SystemMaxUse=200M`, as in v3.0.0. Check: molecule verify's existing journal-cap assertion.
- [ ] With `system_baseline_journal_max_use: ""`, the role creates no drop-in directory or file and does not notify `Restart systemd-journald`. Check: a molecule scenario that sets it and asserts the file does not exist on a fresh instance.
- [ ] With a value that is not empty and not a size (`300`, `0`, `10 M`, a value with a line break), the run stops before any change with a message that names the input. Check: a "refuse" scenario in the style of `refuse_reboot.yml`.
- [ ] The spec entry and README row say that empty leaves the host alone and that clearing the value later removes nothing. Check: `ansible-doc -t role mortis.kamino.system_baseline`; review.
- [ ] A `minor_changes` fragment exists. Check: `pre-commit run --all-files`.
This is the contributor's own code and is offered under GPL-3.0-or-later, the Collection's licence.
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_baselinecaps the persistent journal on every host (SystemMaxUse, default200M) with no way to opt out. A consumer who manages journald elsewhere (a different drop-in, a host with its own size policy, a host whose cap is set by another role) can only set a value that happens to match theirs, and the role still writes its own drop-in and restartssystemd-journaldwhen it changes. Setting the input to an empty string today writesSystemMaxUse=(an empty assignment) rather than leaving the host alone, and any other bad value (0, a bare300, a typo) is written unchecked.Out of scope: other journald settings, removing a drop-in that an earlier run wrote, changing the
200Mdefault.Proposal
Treat an empty
system_baseline_journal_max_useas "do not manage", exactly assystem_baseline_apt_daily_timeoutdoes:tasks/main.ymladdwhen: system_baseline_journal_max_use | length > 0to the journald import (the apt-daily import useswhen: system_baseline_apt_daily_timeout | length > 0). With an empty value neither the drop-in directory, the drop-in file nor the journald restart handler runs.tasks/validate.ymlin the style of the apt-daily one: the value is a string and is either empty or matches a one-line size pattern (a number followed byK,M,GorT, optionallyinfinity), so a bare integer or a value with a newline is refused before any change. The exact pattern is the maintainer's call; the principle is that a value written into a unit-style file is checked as the apt-daily value is.argument_specs.yml: keeptype: str,default: 200M, and add the sentence "Empty leaves the host alone; clearing the value later does not remove a file already written."The default stays
200M, so a consumer who does not set it sees no change.Question for the maintainer: should an empty value also remove a drop-in a previous run wrote? The apt-daily input deliberately does not, and this proposal matches it.
Acceptance criteria
/etc/systemd/journald.conf.d/50-system-baseline.confwithSystemMaxUse=200M, as in v3.0.0. Check: molecule verify's existing journal-cap assertion.system_baseline_journal_max_use: "", the role creates no drop-in directory or file and does not notifyRestart systemd-journald. Check: a molecule scenario that sets it and asserts the file does not exist on a fresh instance.300,0,10 M, a value with a line break), the run stops before any change with a message that names the input. Check: a "refuse" scenario in the style ofrefuse_reboot.yml.ansible-doc -t role mortis.kamino.system_baseline; review.minor_changesfragment exists. Check:pre-commit run --all-files.This is the contributor's own code and is offered under GPL-3.0-or-later, the Collection's licence.
Assisted-by: Claude Code