Skip to content

Instantly share code, notes, and snippets.

@cmarzullo
Last active April 24, 2017 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmarzullo/f13221e6dac191ef86d7d35564ac1b3e to your computer and use it in GitHub Desktop.
Save cmarzullo/f13221e6dac191ef86d7d35564ac1b3e to your computer and use it in GitHub Desktop.
{% for plugin, data in collectd.plugins.iteritems() %}
collectd_config_{{ plugin }}:
file.{{ data.state }}:
- name: '/etc/collectd/collectd.conf.d/{{ plugin }}.conf'
- watch_in:
- service: collectd_service
{% if data.state == 'managed' -%}
- source: 'salt://collectd/files/collectd.conf.d/{{ plugin }}.conf.j2'
- user: 'root'
- group: 'root'
- mode: 0644
- template: jinja
- data: {{ data }}
{%- endif %}
{% endfor %}
{%- from "collectd/map.jinja" import collectd with context -%}
{% if data.disks is defined -%}
LoadPlugin smart
<Plugin smart>
{% for disk in data.disks -%}
Disk "{{ disk }}"
{% endfor %}
</Plugin>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment