added template for extra plugins

This commit is contained in:
Steven Wirges
2016-06-23 12:56:59 +02:00
parent cf37fb1d2e
commit 01d05b0a88
2 changed files with 45 additions and 1 deletions

View File

@ -37,7 +37,7 @@
- name: "Copy telegraf extra plugins" - name: "Copy telegraf extra plugins"
template: template:
src: "telegraf.conf.j2" src: "telegraf-extra-plugin.conf.j2"
dest: "/etc/telegraf/telegraf.d/{{ item.plugin }}.conf" dest: "/etc/telegraf/telegraf.d/{{ item.plugin }}.conf"
owner: root owner: root
group: root group: root

View File

@ -0,0 +1,44 @@
{% if telegraf_plugins_extra is defined and telegraf_plugins_extra is iterable %}
{% for item in telegraf_plugins_extra %}
[[inputs.{{ item.plugin }}]]
{% if item.interval is defined %}
interval = "{{ item.interval }}s"
{% endif %}
{% if item.config is defined and item.config is iterable %}
{% for items in item.config %}
{{ items }}
{% endfor %}
{% endif %}
{% if item.tagpass is defined and item.tagpass is iterable %}
[{{ item.plugin }}.tagpass]
{% for items in item.tagpass %}
{{ items }}
{% endfor %}
{% endif %}
{% if item.tagdrop is defined and item.tagdrop is iterable %}
[{{ item.plugin }}.tagdrop]
{% for items in item.tagdrop %}
{{ items }}
{% endfor %}
{% endif %}
{% if item.pass is defined and item.pass is iterable %}
[{{ item.plugin }}.pass]
{% for items in item.pass %}
{{ items }}
{% endfor %}
{% endif %}
{% if item.drop is defined and item.drop is iterable %}
[{{ item.plugin }}.drop]
{% for items in item.drop %}
{{ items }}
{% endfor %}
{% endif %}
{% if item.specifications is defined and item.specifications is iterable %}
[[{{item.plugin}}.specifications]]
{% for items in item.specifications %}
{{ items }}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}