2015-10-02 00:38:55 -04:00
|
|
|
{% from "munin/map.jinja" import munin_node with context %}
|
|
|
|
|
|
|
|
include:
|
|
|
|
- munin.node
|
|
|
|
|
|
|
|
# Enable common plugins
|
|
|
|
{% for plugin, linked_file in pillar.get('munin_node_common_plugins', {}).items() %}
|
2017-11-02 08:46:21 -04:00
|
|
|
{{ munin_node.plugin_dir }}/{{ plugin }}:
|
2015-10-02 00:38:55 -04:00
|
|
|
file.symlink:
|
2017-11-02 10:40:58 -04:00
|
|
|
- target: {{ munin_node.plugin_target_dir}}/{{ linked_file }}
|
2017-11-02 08:46:21 -04:00
|
|
|
- user: {{ munin_node.file_user }}
|
|
|
|
- group: {{ munin_node.file_group }}
|
2015-10-02 00:38:55 -04:00
|
|
|
- mode: 755
|
|
|
|
{% endfor %}
|
|
|
|
|
2015-11-13 20:11:19 -05:00
|
|
|
# Node specific plugins
|
2015-12-02 08:05:38 -05:00
|
|
|
{% for hostname, plugin in salt['pillar.get']('munin_node_specific_plugins', {}).items() %}
|
2015-11-13 20:11:19 -05:00
|
|
|
{% if salt['pillar.get']('munin_node:host_name') == hostname %}
|
|
|
|
{% for plugin_name, linked_file in plugin.items() %}
|
2017-11-02 08:46:21 -04:00
|
|
|
{{ munin_node.plugin_dir }}/{{ plugin_name }}:
|
2015-11-13 20:11:19 -05:00
|
|
|
file.symlink:
|
2017-11-02 10:40:58 -04:00
|
|
|
- target: {{ munin_node.plugin_target_dir}}/{{ linked_file }}
|
2017-11-02 08:46:21 -04:00
|
|
|
- user: {{ munin_node.file_user }}
|
|
|
|
- group: {{ munin_node.file_group }}
|
2015-11-13 20:11:19 -05:00
|
|
|
- mode: 755
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
|
2015-10-02 00:38:55 -04:00
|
|
|
{{ munin_node.service }}:
|
|
|
|
service.running:
|
|
|
|
- watch:
|
2017-11-02 08:46:21 -04:00
|
|
|
- file: {{ munin_node.plugin_dir }}/*
|