successful munin master config creation based on pillar data
This commit is contained in:
parent
f6e5dfb11a
commit
acc98d43df
@ -0,0 +1,35 @@
|
||||
{% 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.iteritems() -%}
|
||||
{{ print_directive(directive, value) }}
|
||||
{% endfor %}
|
||||
|
||||
{%- for host, directives in hosts.iteritems() %}
|
||||
[{{ host }}]
|
||||
{%- for directive, value in directives.iteritems() %}
|
||||
{{ print_directive(directive, value) }}
|
||||
{%- endfor %}
|
||||
{% endfor %}
|
||||
|
||||
{%- for group, directives in groups.iteritems() %}
|
||||
[{{ group }}]
|
||||
{%- for directive, value in directives.iteritems() %}
|
||||
{{ print_directive(directive, value) }}
|
||||
{%- endfor %}
|
||||
{% endfor %}
|
@ -0,0 +1,11 @@
|
||||
{% from "munin/map.jinja" import munin_master with context %}
|
||||
|
||||
include:
|
||||
- munin.master
|
||||
|
||||
munin_master_config:
|
||||
file.managed:
|
||||
- name: {{ munin_master.config }}
|
||||
- source: {{ munin_master.config_src }}
|
||||
- template: jinja
|
||||
|
@ -1,13 +1,14 @@
|
||||
munin_master:
|
||||
dbdir: "/var/lib/munin"
|
||||
htmldir: "/var/cache/munin/www"
|
||||
logdir: "/var/log/munin"
|
||||
rundir: "/var/run/munin"
|
||||
includerdir: "/etc/munin/munin-conf.d"
|
||||
globals:
|
||||
dbdir: "/var/lib/munin"
|
||||
htmldir: "/var/cache/munin/www"
|
||||
logdir: "/var/log/munin"
|
||||
rundir: "/var/run/munin"
|
||||
includedir: "/etc/munin/munin-conf.d"
|
||||
hosts:
|
||||
- "localhost.localdomain":
|
||||
- address: "127.0.0.1"
|
||||
- use_node_name: yes
|
||||
"localhost.localdomain":
|
||||
address: "127.0.0.1"
|
||||
use_node_name: "yes"
|
||||
|
||||
munin_node:
|
||||
log_level: 4
|
||||
|
Loading…
Reference in New Issue
Block a user