2019-05-10 01:49:38 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=jinja
|
|
|
|
|
|
|
|
{#- Get the `tplroot` from `tpldir` #}
|
|
|
|
{%- set tplroot = tpldir.split('/')[0] %}
|
|
|
|
{#- Start imports as #}
|
2019-08-25 23:19:15 +02:00
|
|
|
{%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %}
|
|
|
|
{%- import_yaml tplroot ~ "/osarchmap.yaml" as osarchmap %}
|
|
|
|
{%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap %}
|
|
|
|
{%- import_yaml tplroot ~ "/osmap.yaml" as osmap %}
|
|
|
|
{%- import_yaml tplroot ~ "/osfingermap.yaml" as osfingermap %}
|
2019-05-10 01:49:38 +02:00
|
|
|
|
2019-08-25 23:19:15 +02:00
|
|
|
{#- Retrieve the config dict only once #}
|
|
|
|
{%- set _config = salt['config.get'](tplroot, default={}) %}
|
|
|
|
|
|
|
|
{%- set defaults = salt['grains.filter_by'](
|
|
|
|
default_settings,
|
|
|
|
default=tplroot,
|
|
|
|
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'
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2019-05-10 01:49:38 +02:00
|
|
|
)
|
|
|
|
)
|
2019-08-25 23:19:15 +02:00
|
|
|
%}
|
|
|
|
|
|
|
|
{%- set config = salt['grains.filter_by'](
|
|
|
|
{'defaults': defaults},
|
|
|
|
default='defaults',
|
|
|
|
merge=_config
|
|
|
|
)
|
|
|
|
%}
|
2019-05-10 01:49:38 +02:00
|
|
|
|
2019-08-25 23:19:15 +02:00
|
|
|
{%- set keepalived = config %}
|