2015-04-06 16:25:27 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=jinja
|
|
|
|
|
2018-10-16 11:31:59 +02:00
|
|
|
{## Start with defaults from defaults.sls and osfamilymap.yml ##}
|
2015-04-06 16:25:27 +02:00
|
|
|
{% import_yaml 'sysctl/defaults.yml' as default_settings %}
|
2018-10-16 11:31:59 +02:00
|
|
|
{% import_yaml "sysctl/osfamilymap.yml" as os_family_map %}
|
2015-04-06 16:25:27 +02:00
|
|
|
|
2018-10-16 11:31:59 +02:00
|
|
|
{% set osfam = salt['grains.filter_by'](
|
|
|
|
os_family_map,
|
|
|
|
grain='os_family',
|
|
|
|
) or {}
|
|
|
|
%}
|
2016-04-26 13:31:39 +02:00
|
|
|
|
2018-10-16 11:31:59 +02:00
|
|
|
{% do salt['defaults.merge'](default_settings['sysctl'], osfam) %}
|
|
|
|
{% do salt['defaults.merge'](
|
|
|
|
default_settings['sysctl'],
|
|
|
|
salt['pillar.get']('sysctl:lookup',{}),
|
|
|
|
)
|
2015-04-06 16:25:27 +02:00
|
|
|
%}
|
2016-04-26 13:31:39 +02:00
|
|
|
|
2018-10-16 11:31:59 +02:00
|
|
|
{## Apply backwards compatiblility after merge ##}
|
|
|
|
{% if default_settings['sysctl']['params'] is defined %}
|
|
|
|
{% do default_settings['sysctl'].pop('params') %}
|
|
|
|
{% endif %}
|
|
|
|
{% if default_settings['sysctl']['params2'] is defined %}
|
|
|
|
{% do default_settings['sysctl'].pop('params2') %}
|
|
|
|
{% endif %}
|
2015-04-06 16:25:27 +02:00
|
|
|
|
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',
|
2018-10-16 11:31:59 +02:00
|
|
|
default=default_settings['sysctl'],
|
|
|
|
merge=True,
|
2015-04-06 16:25:27 +02:00
|
|
|
)
|
|
|
|
%}
|