paulbsd-salt/states/sysctl/init.sls
Paul d164fd73f1
All checks were successful
continuous-integration/drone/push Build is passing
updated sysctl state
2025-03-17 09:06:55 +01:00

23 lines
551 B
Plaintext

{%- from "sysctl/map.jinja" import sysctl with context %}
{%- for file,sysctls in sysctl.config.items() %}
sysctl-file-{{ file }}:
file.managed:
- name: /etc/sysctl.d/{{ file }}.conf
sysctl-values-{{ file }}:
file.keyvalue:
- name: /etc/sysctl.d/{{ file }}.conf
- key_values:
{%- for key,value in sysctls.items() %}
{{ key }}: {{ value }}
{%- endfor %}
- separator: '='
- uncomment: '# '
- key_ignore_case: True
- append_if_not_found: True
{%- endfor %}
sysctl-apply:
cmd.run:
- name: "sysctl --system"