mirror of
https://github.com/dj-wasabi/ansible-telegraf.git
synced 2025-07-17 08:46:37 +00:00
Added support for plugins being managed exclusively by this playbook
This commit is contained in:
@ -47,6 +47,7 @@ telegraf_plugins_default:
|
|||||||
|
|
||||||
# extra configuration - /etc/telegraf/telegraf.d/*
|
# extra configuration - /etc/telegraf/telegraf.d/*
|
||||||
telegraf_plugins_extra: {}
|
telegraf_plugins_extra: {}
|
||||||
|
telegraf_plugins_extra_exclusive: False
|
||||||
|
|
||||||
# RedHat specific settings for convenience
|
# RedHat specific settings for convenience
|
||||||
telegraf_redhat_releasever: "$releasever"
|
telegraf_redhat_releasever: "$releasever"
|
||||||
|
@ -35,6 +35,25 @@
|
|||||||
when: telegraf_agent_version is version_compare('0.10.0', '>=')
|
when: telegraf_agent_version is version_compare('0.10.0', '>=')
|
||||||
notify: "Restart Telegraf"
|
notify: "Restart Telegraf"
|
||||||
|
|
||||||
|
- name: "Delete telegraf extra plugin path"
|
||||||
|
file:
|
||||||
|
state: absent
|
||||||
|
path: "/etc/telegraf/telegraf.d/"
|
||||||
|
when: "telegraf_plugins_extra_exclusive == True"
|
||||||
|
become: yes
|
||||||
|
notify: "Restart Telegraf"
|
||||||
|
|
||||||
|
- name: "Delete telegraf extra plugin path"
|
||||||
|
file:
|
||||||
|
state: present
|
||||||
|
path: "/etc/telegraf/telegraf.d/"
|
||||||
|
owner: telegraf
|
||||||
|
group: telegraf
|
||||||
|
mode: 0640
|
||||||
|
when: "telegraf_plugins_extra_exclusive == True"
|
||||||
|
become: yes
|
||||||
|
notify: "Restart Telegraf"
|
||||||
|
|
||||||
- name: "Copy telegraf extra plugins"
|
- name: "Copy telegraf extra plugins"
|
||||||
template:
|
template:
|
||||||
src: "telegraf-extra-plugin.conf.j2"
|
src: "telegraf-extra-plugin.conf.j2"
|
||||||
|
Reference in New Issue
Block a user