sysctl-formula/sysctl/map.jinja

43 lines
1.1 KiB
Plaintext
Raw Normal View History

# -*- coding: utf-8 -*-
# vim: ft=jinja
{## Start with defaults from defaults.sls ##}
{% import_yaml 'sysctl/defaults.yml' as default_settings %}
{## 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',
}
},
'Suse': {
"pkg": "procps",
"config": {
"location": '/etc/sysctl.d',
}
},
'Debian': {
"pkg": "procps",
"config": {
"location": '/etc/sysctl.d',
}
},
}, grain="os_family")
%}
{## Merge the flavor_map to the default settings ##}
{% do default_settings.sysctl.update(os_family_map) %}
{## Merge in sysctl:lookup pillar ##}
{% set sysctl_settings = salt['pillar.get'](
'sysctl:lookup',
default=default_settings.sysctl,
merge=True
)
%}