2019-04-24 18:18:44 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=jinja
|
|
|
|
|
|
|
|
{#- Get the `tplroot` from `tpldir` #}
|
|
|
|
{%- set tplroot = tpldir.split('/')[0] %}
|
|
|
|
{#- Start imports as #}
|
|
|
|
{%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %}
|
2019-06-08 19:39:21 +02:00
|
|
|
{%- import_yaml tplroot ~ "/osarchmap.yaml" as osarchmap %}
|
2019-06-20 02:36:58 +02:00
|
|
|
{%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap %}
|
2019-04-24 18:18:44 +02:00
|
|
|
|
|
|
|
{%- set defaults = salt['grains.filter_by'](default_settings,
|
2019-06-22 23:34:37 +02:00
|
|
|
default='prometheus',
|
|
|
|
merge=salt['grains.filter_by'](osarchmap, grain='osarch',
|
|
|
|
merge=salt['grains.filter_by'](osfamilymap, grain='os_family',
|
|
|
|
merge=salt['pillar.get']('prometheus:lookup', default={})
|
|
|
|
)
|
|
|
|
)
|
|
|
|
) %}
|
|
|
|
|
2019-04-24 18:18:44 +02:00
|
|
|
|
|
|
|
{#- Merge the prometheus pillar #}
|
|
|
|
{%- set prometheus = salt['pillar.get']('prometheus', default=defaults, merge=True) %}
|
2019-04-26 14:02:30 +02:00
|
|
|
|
|
|
|
{#- Contactenate arguments #}
|
|
|
|
{%- macro concat_args(args) %}
|
|
|
|
{%- set args = args|dictsort %}
|
|
|
|
{%- if args|length > 0 %}
|
|
|
|
{%- for k,v in args -%}
|
|
|
|
{%- if not k or not v %}{% continue %}{% endif -%}
|
|
|
|
--{{ k }}={{ v }}
|
|
|
|
{%- if not loop.last %} {% endif -%}
|
|
|
|
{%- endfor -%}
|
|
|
|
{%- endif -%}
|
|
|
|
{%- endmacro %}
|