-
-
Save dseira/5e8911ef898674843732 to your computer and use it in GitHub Desktop.
sysctl formula
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sysctl: | |
config: | |
location: '/etc/sysctl.d' | |
params: | |
- | |
name: net.ipv4.ip_forward | |
value: 0 | |
- | |
name: kernel.sysrq | |
value: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% import_yaml 'sysctl/defaults.yaml' as defaults_settings %} | |
{% set sysctl_settings = salt['pillar.get']( | |
'sysctl', | |
default=defaults_settings.sysctl, | |
merge=True | |
) | |
%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% from "sysctl/map.jinja" import sysctl_settings with context %} | |
{% for param in sysctl_settings.params %} | |
{% if param is mapping %} | |
sysctl_present_{{ param.name }}: | |
sysctl.present: | |
- name: {{ param.name }} | |
- value: {{ param.value }} | |
{% endif %} | |
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% elif grains['fqdn'] == 'server1' %} | |
sysctl: | |
config: | |
location: '/etc/sysctl.d' | |
params: | |
- | |
name: net.ipv4.ip_forward | |
value: 1 | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment