1
0
Fork 0
mirror of synced 2024-11-05 09:18:57 -05:00
formula-grafana/grafana/meta/salt.yml
Filip Pytloun 44657188cf Manage grains using support metadata
Change-Id: I8ab61330338213b474ec372e911667f7255eafbd
2017-05-02 14:51:01 +02:00

16 lines
814 B
YAML

grain:
{%- if pillar.grafana.collector is defined %}
{%- if collector.get('enabled', False) %}
{%- set service_grains = {} %}
{%- for service_name, service in pillar.iteritems() %}
{%- if service.get('_support', {}).get('grafana', {}).get('enabled', False) %}
{%- macro load_grains_file(grains_fragment_file) %}{% include grains_fragment_file ignore missing %}{% endmacro %}
{%- set grains_fragment_file = service_name+'/meta/grafana.yml' %}
{%- set grains_yaml = load_grains_file(grains_fragment_file)|load_yaml %}
{%- set service_grains = salt['grains.filter_by']({'default': service_grains}, merge=grains_yaml) %}
{%- endif %}
{%- endfor %}
grafana:
{{ service_grains|yaml(False)|indent(4) }}
{%- endif %}
{%- endif %}