mirror of
https://github.com/dj-wasabi/ansible-telegraf.git
synced 2025-07-17 08:46:37 +00:00
Consolidate instead to a single extra-plugins conf file, to cover the case of multiple instances of same plugin
This commit is contained in:
@ -34,11 +34,10 @@
|
|||||||
- name: "Copy telegraf extra plugins"
|
- name: "Copy telegraf extra plugins"
|
||||||
template:
|
template:
|
||||||
src: "telegraf-extra-plugin.conf.j2"
|
src: "telegraf-extra-plugin.conf.j2"
|
||||||
dest: "/etc/telegraf/telegraf.d/{{ item.plugin }}.conf"
|
dest: "/etc/telegraf/telegraf.d/extra-plugins.conf"
|
||||||
owner: telegraf
|
owner: telegraf
|
||||||
group: telegraf
|
group: telegraf
|
||||||
mode: 0640
|
mode: 0640
|
||||||
with_items: "{{ telegraf_plugins_extra }}"
|
|
||||||
when: "telegraf_plugins_extra is defined and telegraf_plugins_extra is iterable"
|
when: "telegraf_plugins_extra is defined and telegraf_plugins_extra is iterable"
|
||||||
become: yes
|
become: yes
|
||||||
notify: "Restart Telegraf"
|
notify: "Restart Telegraf"
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
{% if telegraf_plugins_extra is defined and telegraf_plugins_extra is iterable %}
|
||||||
|
{% for item in telegraf_plugins_extra %}
|
||||||
[[inputs.{{ item.plugin }}]]
|
[[inputs.{{ item.plugin }}]]
|
||||||
{% if item.interval is defined %}
|
{% if item.interval is defined %}
|
||||||
interval = "{{ item.interval }}s"
|
interval = "{{ item.interval }}s"
|
||||||
@ -43,3 +45,5 @@
|
|||||||
{{ items }}
|
{{ items }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
Reference in New Issue
Block a user