firewalld-formula/firewalld/map.jinja
Steven Daniele afcf5e7700
refactor: split default maps into separate files
While the default maps are mostly empty this sets the groundwork for
distribution specific defaults. The layout is based on the formula
template.

BREAKING CHANGE: `map.jinja` has been upgraded from using `pillar.get`
to `config.get`.
2020-04-18 15:53:46 +01:00

31 lines
1.0 KiB
Django/Jinja

# -*- coding: utf-8 -*-
# vim: ft=jinja
{#- Start with defaults from defaults.yaml #}
{% import_yaml "firewalld/defaults.yaml" as default_settings %}
{% import_yaml "firewalld/osarchmap.yaml" as osarchmap %}
{% import_yaml "firewalld/osfamilymap.yaml" as osfamilymap %}
{% import_yaml "firewalld/osmap.yaml" as osmap %}
{% import_yaml "firewalld/osfingermap.yaml" as osfingermap %}
{% set _config = salt['config.get']('firewalld', default={}) %}
{% set defaults = salt['grains.filter_by'](default_settings,
default='firewalld',
merge=salt['grains.filter_by'](osarchmap, grain='osarch',
merge=salt['grains.filter_by'](osfamilymap, grain='os_family',
merge=salt['grains.filter_by'](osmap, grain='os',
merge=salt['grains.filter_by'](osfingermap, grain='osfinger',
merge=salt['grains.filter_by'](_config, default='lookup')
)
)
)
)
) %}
{% set firewalld = salt['grains.filter_by'](
{'defaults': defaults},
default='defaults',
merge=_config
) %}