feat(system_baseline): let system_baseline_journal_max_use be empty to leave journald alone
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
This commit is contained in:
1 parent
6a2060bd31
commit
c51fa998b9
9 files changed
+117
-3
No files matched your search
@@ -0,0 +1,18 @@
|
||||
---
|
||||
# One refusal: the role must stop on validation, before it changes anything, with a message that names the variable.
|
||||
- name: Run the role with a bad system_baseline_journal_max_use
|
||||
block:
|
||||
- name: Include system_baseline
|
||||
ansible.builtin.include_role:
|
||||
name: mortis.kamino.system_baseline
|
||||
vars:
|
||||
system_baseline_system_type: ubuntu_lxc
|
||||
system_baseline_journal_max_use: "{{ system_baseline_refused_journal }}"
|
||||
- name: Unreachable when validation works
|
||||
ansible.builtin.fail:
|
||||
msg: system_baseline ran with an invalid system_baseline_journal_max_use
|
||||
rescue:
|
||||
- name: The validation stopped the play
|
||||
ansible.builtin.assert:
|
||||
that: "'system_baseline_journal_max_use must be' in ansible_failed_result.msg | default('')"
|
||||
quiet: true
|
||||
Reference in new issue
Block a user