fix(system_baseline): persist sysctls in an own sysctl.d drop-in
systemd-sysctl on Debian 13 does not read /etc/sysctl.conf, so the hardened values were lost on reboot. The role now applies the live values on their own, writes them to a drop-in under /etc/sysctl.d and removes its keys from /etc/sysctl.conf. Refs #510 Assisted-by: Claude Code:claude-opus-5-5
This commit is contained in:
1 parent
cf99893855
commit
d88e5d237a
14 files changed
+282
-17
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_sysctl_file
|
||||
block:
|
||||
- name: Include system_baseline
|
||||
ansible.builtin.include_role:
|
||||
name: mortis.kamino.system_baseline
|
||||
vars:
|
||||
system_baseline_system_type: ubuntu_lxc
|
||||
system_baseline_sysctl_file: "{{ system_baseline_refused_sysctl_file }}"
|
||||
- name: Unreachable when validation works
|
||||
ansible.builtin.fail:
|
||||
msg: system_baseline ran with an invalid system_baseline_sysctl_file
|
||||
rescue:
|
||||
- name: The validation stopped the play
|
||||
ansible.builtin.assert:
|
||||
that: "'system_baseline_sysctl_file must be' in ansible_failed_result.msg | default('')"
|
||||
quiet: true
|
||||
Reference in new issue
Block a user