0
0
mirror of https://github.com/saltstack-formulas/sysctl-formula.git synced 2024-11-28 03:28:13 +01:00
sysctl-formula/sysctl/map.jinja
Mark Gomersbach 9a0c5cc6f1
Move data to YAML files and keep map.jinja a template
- Add Gentoo support
- Add FreeBSD support
2018-10-16 11:31:59 +02:00

36 lines
986 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,
)
%}