munin-formula/munin/node/plugins.sls

34 lines
1.0 KiB
Plaintext
Raw Normal View History

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() %}
{{ munin_node.plugin_dir }}/{{ plugin }}:
2015-10-02 00:38:55 -04:00
file.symlink:
- target: {{ munin_node.plugin_target_dir}}/{{ linked_file }}
- 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
{% 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() %}
{{ munin_node.plugin_dir }}/{{ plugin_name }}:
2015-11-13 20:11:19 -05:00
file.symlink:
- target: {{ munin_node.plugin_target_dir}}/{{ linked_file }}
- 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:
- file: {{ munin_node.plugin_dir }}/*