0
0
mirror of https://github.com/saltstack-formulas/sysctl-formula.git synced 2024-12-18 11:03:08 +01:00
sysctl-formula/sysctl/map.jinja

36 lines
983 B
Plaintext
Raw Normal View History

# -*- 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,
)
%}