feat(system_baseline): let system_baseline_journal_max_use be empty to leave journald alone #415

Merged
Defame1297 merged 1 commits from feat/401-journal-max-use-empty into main 2026-11-27 07:36:10 +00:00
Collaborator

What and why

Closes #401

system_baseline capped the persistent journal on every host with no way to opt out, and wrote system_baseline_journal_max_use into the drop-in unchecked: an empty value produced an empty SystemMaxUse=, and a bare number, a typo or a line break went into the file as it was.

  • tasks/main.yml: the journald import has when: system_baseline_journal_max_use | length > 0, as the apt-daily import does. With an empty value there is no drop-in directory, no drop-in file and no restart of systemd-journald. A file an earlier run wrote stays (the issue's proposal, matching the apt-daily input).
  • tasks/validate.yml (tag always, so --tags journald validates too): the value is empty, infinity, or a number followed by K, M, G or T. A bare number, a space or a line break stops the run before any change, with a message that names the input.
  • argument_specs, README (table row, a section "Leaving journald alone", the Tests list), a comment in defaults/main.yml, and a minor_changes fragment. The default stays 200M.
  • Tests: converge refuses "300", "0", 10 M, 10m, a value with a line break and the integer 300 (new tasks/refuse_journal_max_use.yml); the last play of verify.yml removes the drop-in, runs the role with an empty value and asserts that no drop-in directory exists and that journald's ActiveEnterTimestampMonotonic did not change.

Decisions you may want to look at

  • The pattern is stricter than systemd's. Before, any string reached the file. Now 1.5G and the P/E suffixes stop the run, because the issue names K, M, G and T. If you want them, it is one regex in tasks/validate.yml. The fragment says that a form which used to be written as it was now stops the run.
  • 0M passes while 0 is refused. It is the same zero-byte cap in a valid form; refusing it would need a rule on the number.
  • infinity is accepted because the issue lists it.

Verified

  • All commit-stage hooks passed (ansible-lint, yamllint, changelog fragments lint, REUSE, Conventional Commit, Assisted-by).
  • On a Debian host with ansible-core 2.22.0, in check mode with --tags journald,always against this branch: 200M, infinity, 2G and 0M validate and reach the drop-in tasks; an empty value skips both journald tasks; "300", "0", "10 M", "10m", "200M\nStorage=none", the integer 300 and infinite each stop with the message that names the input.
  • An independent read-only review found no blocking defect; its findings (a comment left above the wrong task, a message that claimed an integer is not a string, a stale-state note for a second local molecule verify, the stricter pattern) are fixed or listed above.

Not verified

  • Molecule: it runs only in CI. In particular nothing here proves that systemctl show systemd-journald --property=ActiveEnterTimestampMonotonic behaves as the new assertion expects in the container, or that the last verify.yml play (a full role run with defaults) leaves nothing that matters. It runs last, because it removes the drop-in and the tmux snippet the converge wrote; a second molecule verify without a converge fails by design.
  • That journald accepts infinity for SystemMaxUse, and its exact size syntax (decimals, P, E): I could not check the manual offline.

  • 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 #401 `system_baseline` capped the persistent journal on every host with no way to opt out, and wrote `system_baseline_journal_max_use` into the drop-in unchecked: an empty value produced an empty `SystemMaxUse=`, and a bare number, a typo or a line break went into the file as it was. - `tasks/main.yml`: the journald import has `when: system_baseline_journal_max_use | length > 0`, as the apt-daily import does. With an empty value there is no drop-in directory, no drop-in file and no restart of `systemd-journald`. A file an earlier run wrote stays (the issue's proposal, matching the apt-daily input). - `tasks/validate.yml` (tag `always`, so `--tags journald` validates too): the value is empty, `infinity`, or a number followed by `K`, `M`, `G` or `T`. A bare number, a space or a line break stops the run before any change, with a message that names the input. - argument_specs, README (table row, a section "Leaving journald alone", the Tests list), a comment in `defaults/main.yml`, and a `minor_changes` fragment. The default stays `200M`. - Tests: converge refuses `"300"`, `"0"`, `10 M`, `10m`, a value with a line break and the integer `300` (new `tasks/refuse_journal_max_use.yml`); the last play of `verify.yml` removes the drop-in, runs the role with an empty value and asserts that no drop-in directory exists and that journald's `ActiveEnterTimestampMonotonic` did not change. ## Decisions you may want to look at - **The pattern is stricter than systemd's.** Before, any string reached the file. Now `1.5G` and the `P`/`E` suffixes stop the run, because the issue names K, M, G and T. If you want them, it is one regex in `tasks/validate.yml`. The fragment says that a form which used to be written as it was now stops the run. - **`0M` passes** while `0` is refused. It is the same zero-byte cap in a valid form; refusing it would need a rule on the number. - **`infinity`** is accepted because the issue lists it. ## Verified - All commit-stage hooks passed (ansible-lint, yamllint, changelog fragments lint, REUSE, Conventional Commit, `Assisted-by`). - On a Debian host with ansible-core 2.22.0, in check mode with `--tags journald,always` against this branch: `200M`, `infinity`, `2G` and `0M` validate and reach the drop-in tasks; an empty value skips both journald tasks; `"300"`, `"0"`, `"10 M"`, `"10m"`, `"200M\nStorage=none"`, the integer `300` and `infinite` each stop with the message that names the input. - An independent read-only review found no blocking defect; its findings (a comment left above the wrong task, a message that claimed an integer is not a string, a stale-state note for a second local `molecule verify`, the stricter pattern) are fixed or listed above. ## Not verified - Molecule: it runs only in CI. In particular nothing here proves that `systemctl show systemd-journald --property=ActiveEnterTimestampMonotonic` behaves as the new assertion expects in the container, or that the last `verify.yml` play (a full role run with defaults) leaves nothing that matters. It runs last, because it removes the drop-in and the tmux snippet the converge wrote; a second `molecule verify` without a converge fails by design. - That journald accepts `infinity` for `SystemMaxUse`, and its exact size syntax (decimals, `P`, `E`): I could not check the manual offline. --- - [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
Dragonish added 1 commit 2026-11-27 06:20:58 +00:00
feat(system_baseline): let system_baseline_journal_max_use be empty to leave journald alone
Build / build (pull_request) Successful in 28s
Lint / lint (pull_request) Successful in 2m33s
Molecule / molecule (pull_request) Successful in 7m29s
c51fa998b9
The role capped the persistent journal on every host with no way to opt
out, and wrote the value into the drop-in unchecked: an empty value
produced an empty SystemMaxUse=, and a bare number, a typo or a line
break went into the file as it was.

An empty system_baseline_journal_max_use now skips the journald task, as
an empty system_baseline_apt_daily_timeout skips its task: no drop-in
directory, no drop-in file and no restart of systemd-journald. A file an
earlier run wrote stays.

Any other value is checked before any change: infinity, or a number
followed by K, M, G or T. A bare number, a space and a line break stop
the run with a message that names the input. The default stays 200M.

Closes #401

Assisted-by: Claude Code:claude-sonnet-5-5
Defame1297 merged commit 7c068c2b47 into main 2026-11-27 07:36:10 +00:00
Defame1297 deleted branch feat/401-journal-max-use-empty 2026-11-27 07:36:10 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#415