fix(system_baseline): accept every size journald reads for the journal cap
The new check on system_baseline_journal_max_use refused sizes journald accepts (a bare byte count, 1.5G, 10 M, P and E units), which 3.1.0 wrote as given, and accepted infinity, which SystemMaxUse does not take. The check now follows journald's parse_size(): a number with an optional upper-case B, K, M, G, T, P or E, still with no line break. Assisted-by: Claude Code
This commit is contained in:
1 parent
5ac8eadac1
commit
985995656a
5 files changed
+21
-18
No files matched your search
@@ -47,16 +47,18 @@
|
||||
ansible.builtin.import_tasks: validate_reboot.yml
|
||||
tags: always
|
||||
|
||||
# The value is written into a journald drop-in: a number and a unit letter, so a bare number (journald reads it as bytes), a space or a line
|
||||
# break (a second directive) never reaches the file. Empty leaves the host alone, as for the apt-daily timeout.
|
||||
# The value is written into a journald drop-in, so it must be a size journald's parse_size() reads: no line break (a second directive), and
|
||||
# no infinity, which SystemMaxUse does not take. Empty leaves the host alone, as for the apt-daily timeout.
|
||||
- name: Validate the journal size cap
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- system_baseline_journal_max_use is string
|
||||
- system_baseline_journal_max_use == '' or system_baseline_journal_max_use is match('^(infinity|[0-9]+[KMGT])\Z')
|
||||
- >-
|
||||
system_baseline_journal_max_use == ''
|
||||
or system_baseline_journal_max_use is match('^([0-9]+(\.[0-9]*)? *[BKMGTPE] *)*[0-9]+(\.[0-9]*)? *[BKMGTPE]?\Z')
|
||||
fail_msg: >-
|
||||
system_baseline_journal_max_use must be empty (leave journald alone), infinity or a size such as 200M or 2G
|
||||
(a number and one of K, M, G, T; a bare number is refused, journald would read it as bytes).
|
||||
system_baseline_journal_max_use must be empty (leave journald alone) or a size journald reads, such as 200M, 1.5G
|
||||
or 1073741824 (bytes): a number with an optional upper-case B, K, M, G, T, P or E.
|
||||
quiet: true
|
||||
tags: always
|
||||
|
||||
|
||||
Reference in new issue
Block a user