munin-formula/munin/files/munin.conf

40 lines
1.0 KiB
Plaintext
Raw Normal View History

{% set config = pillar.get('munin_master', {}) -%}
{% set globals = config.get('globals', {}) -%}
{% set hosts = config.get('hosts', {}) -%}
{% set groups = config.get('groups', {}) -%}
#
# This config file is managed by salt.
#
{%- macro print_directive(directive, value) -%}
{%- if value is sameas true -%}
{{ directive }} yes
{%- elif value is sameas false %}
{{ directive }} no
{%- else -%}
{{ directive }} {{ value }}
{%- endif -%}
{%- endmacro %}
{% for directive, value in globals.items() -%}
{{ print_directive(directive, value) }}
{% endfor %}
{%- for host, directives in hosts.items() %}
[{{ host }}]
{%- for directive, value in directives.items() %}
{{ print_directive(directive, value) }}
{%- endfor %}
{% endfor %}
{%- for group, directives in groups.items() %}
[{{ group }}]
{%- for directive, value in directives.items() %}
{{ print_directive(directive, value) }}
{%- endfor %}
{% endfor %}
{%- if config.get('formula_append') %}
{{ config.formula_append }}
{% endif %}