forked from saltstack-formulas/template-formula
-
Notifications
You must be signed in to change notification settings - Fork 0
/
map.jinja
24 lines (21 loc) · 876 Bytes
/
map.jinja
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -*- coding: utf-8 -*-
# vim: ft=jinja
{#- Get the `topdir` from `tpldir` #}
{%- set topdir = tpldir.split('/')[0] %}
{#- Start imports as #}
{%- import_yaml topdir ~ "/defaults.yaml" as default_settings %}
{%- import_yaml topdir ~ "/osfamilymap.yaml" as osfamilymap %}
{%- import_yaml topdir ~ "/osmap.yaml" as osmap %}
{%- import_yaml topdir ~ "/osfingermap.yaml" as osfingermap %}
{% set defaults = salt['grains.filter_by'](default_settings,
default='template',
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['pillar.get']('template:lookup', default={})
)
)
)
) %}
{#- Merge the template pillar #}
{% set template = salt['pillar.get']('template', default=defaults, merge=True) %}