Added support for plugins being managed exclusively by this playbook

This commit is contained in:
or
2018-08-15 21:13:04 +03:00
parent db7b456f6d
commit 323e5f8831
2 changed files with 20 additions and 0 deletions

View File

@ -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"

View File

@ -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"