keepalived-formula/keepalived/map.jinja

25 lines
902 B
Plaintext
Raw Normal View History

# -*- coding: utf-8 -*-
# vim: ft=jinja
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{#- Start imports as #}
{%- import_yaml tplroot ~ "/defaults.yaml" or {} as default_settings %}
{%- import_yaml tplroot ~ "/osfamilymap.yaml" or {} as osfamilymap %}
{%- import_yaml tplroot ~ "/osmap.yaml" or {} as osmap %}
{%- import_yaml tplroot ~ "/osfingermap.yaml" or {} as osfingermap %}
{%- set defaults = salt['grains.filter_by'](default_settings,
default='keepalived',
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']('keepalived:lookup', default={})
)
)
)
) %}
{#- Merge the keepalived pillar #}
{%- set keepalived = salt['pillar.get']('keepalived', default=defaults, merge=True) %}