2015-04-06 16:25:27 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=jinja
|
|
|
|
|
|
|
|
{## Start with defaults from defaults.sls ##}
|
|
|
|
{% import_yaml 'sysctl/defaults.yml' as default_settings %}
|
|
|
|
|
2016-04-26 13:31:39 +02:00
|
|
|
{% set sysctl_lookup = salt['pillar.get']('sysctl:lookup', {}).copy() %}
|
|
|
|
|
|
|
|
{% if sysctl_lookup.params is defined %}
|
|
|
|
{% do sysctl_lookup.pop('params') %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if sysctl_lookup.params2 is defined %}
|
|
|
|
{% do sysctl_lookup.pop('params2') %}
|
|
|
|
{% endif %}
|
|
|
|
|
2015-04-06 16:25:27 +02:00
|
|
|
{## setup variable using grains['os_family'] based logic ##}
|
|
|
|
{% set os_family_map = salt['grains.filter_by']({
|
|
|
|
'Arch': {
|
|
|
|
"config": {
|
|
|
|
"location": '/etc/sysctl.d',
|
|
|
|
}
|
2015-05-12 15:48:08 +02:00
|
|
|
},
|
|
|
|
'RedHat': {
|
|
|
|
"config": {
|
|
|
|
"location": '/etc/sysctl.conf',
|
|
|
|
}
|
2015-06-09 23:30:54 +02:00
|
|
|
},
|
|
|
|
'Suse': {
|
|
|
|
"pkg": "procps",
|
|
|
|
"config": {
|
|
|
|
"location": '/etc/sysctl.d',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'Debian': {
|
|
|
|
"pkg": "procps",
|
|
|
|
"config": {
|
|
|
|
"location": '/etc/sysctl.d',
|
|
|
|
}
|
|
|
|
},
|
2016-04-26 13:31:39 +02:00
|
|
|
},
|
|
|
|
grain="os_family",
|
|
|
|
merge=sysctl_lookup)
|
2015-04-06 16:25:27 +02:00
|
|
|
%}
|
2016-04-26 13:31:39 +02:00
|
|
|
|
2015-04-06 16:25:27 +02:00
|
|
|
{## Merge the flavor_map to the default settings ##}
|
|
|
|
{% do default_settings.sysctl.update(os_family_map) %}
|
|
|
|
|
2016-04-26 13:31:39 +02:00
|
|
|
{## Merge in sysctl pillar ##}
|
2015-04-06 16:25:27 +02:00
|
|
|
{% set sysctl_settings = salt['pillar.get'](
|
2016-04-26 13:31:39 +02:00
|
|
|
'sysctl',
|
2015-04-06 16:25:27 +02:00
|
|
|
default=default_settings.sysctl,
|
|
|
|
merge=True
|
|
|
|
)
|
|
|
|
%}
|