munin-formula/munin/files/munin.conf
2015-11-17 10:15:21 -03:00

36 lines
950 B
Plaintext

{% 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 %}