From 11d3331958023766568cc3614b5a1ae0dcfb952b Mon Sep 17 00:00:00 2001 From: Jeremy Dubois Date: Mon, 12 Oct 2020 15:45:13 +0200 Subject: [PATCH] Collectd role : deletion of collectd_plugin_exec variable This variable had to be activated only if collectd_plugin_exec_ifq_drops or collectd_plugin_exec_dns_stats was also activated, for some configuration to be taken into account. I changed the role so that the configuration is automatically taken into account if one of these two variables is activated. --- roles/collectd/defaults/main.yml | 1 - roles/collectd/tasks/main.yml | 2 +- roles/collectd/templates/collectd.conf.j2 | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/roles/collectd/defaults/main.yml b/roles/collectd/defaults/main.yml index 8460a72..7974087 100644 --- a/roles/collectd/defaults/main.yml +++ b/roles/collectd/defaults/main.yml @@ -10,7 +10,6 @@ collectd_interval: "300" # exec plugin -collectd_plugin_exec: false # Set to true only if one of the exec plugins below is also set to true collectd_plugin_exec_interval: "{{ collectd_interval }}" collectd_plugin_exec_ifq_drops: false collectd_plugin_exec_dns_stats: false # Based on unbound diff --git a/roles/collectd/tasks/main.yml b/roles/collectd/tasks/main.yml index 77a5988..4ff066b 100644 --- a/roles/collectd/tasks/main.yml +++ b/roles/collectd/tasks/main.yml @@ -24,7 +24,7 @@ file: path: /usr/local/share/collectd/scripts state: directory - when: collectd_plugin_exec + when: collectd_plugin_exec_ifq_drops or collectd_plugin_exec_dns_stats tags: - collectd diff --git a/roles/collectd/templates/collectd.conf.j2 b/roles/collectd/templates/collectd.conf.j2 index 6ce9e7d..2cae0ac 100644 --- a/roles/collectd/templates/collectd.conf.j2 +++ b/roles/collectd/templates/collectd.conf.j2 @@ -6,7 +6,7 @@ LoadPlugin syslog LogLevel warning -{% if collectd_plugin_exec is sameas true %} +{% if (collectd_plugin_exec_ifq_drops is sameas true) or (collectd_plugin_exec_dns_stats is sameas true) %} Interval {{ collectd_plugin_exec_interval }}