36 lines
983 B
Django/Jinja
36 lines
983 B
Django/Jinja
# -*- coding: utf-8 -*-
|
|
# vim: ft=jinja
|
|
|
|
{#- Start with defaults from defaults.sls and osfamilymap.yml #}
|
|
{% import_yaml 'sysctl/defaults.yml' as default_settings %}
|
|
{% import_yaml "sysctl/osfamilymap.yml" as os_family_map %}
|
|
|
|
{% set osfam = salt['grains.filter_by'](
|
|
os_family_map,
|
|
grain='os_family',
|
|
) or {}
|
|
%}
|
|
|
|
{% do salt['defaults.merge'](default_settings['sysctl'], osfam) %}
|
|
{% do salt['defaults.merge'](
|
|
default_settings['sysctl'],
|
|
salt['pillar.get']('sysctl:lookup',{}),
|
|
)
|
|
%}
|
|
|
|
{#- 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 %}
|
|
|
|
{#- Merge in sysctl pillar #}
|
|
{% set sysctl_settings = salt['pillar.get'](
|
|
'sysctl',
|
|
default=default_settings['sysctl'],
|
|
merge=True,
|
|
)
|
|
%}
|