From 6b5176e82fae5e0b10c837d2ee6d3b423361b1a2 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 29 Jul 2016 10:52:07 +0200 Subject: [PATCH] library/roles/couchbase: Modify the ganglia plugin handling to manage the removal. d4science-ghn-cluster: disable the ganglia couchbase plugin, gmond apparently cannot handle its load. --- couchbase/defaults/main.yml | 1 + couchbase/tasks/ganglia-plugin.yml | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/couchbase/defaults/main.yml b/couchbase/defaults/main.yml index 4eaece17..bcbf2384 100644 --- a/couchbase/defaults/main.yml +++ b/couchbase/defaults/main.yml @@ -42,6 +42,7 @@ couchbase_allowed_hosts: - '{{ network.nmis }}' - '{{ ansible_default_ipv4.address }}/32' +couchbase_ganglia_plugin_enabled: True #couchbase_ganglia_url_username: #couchbase_ganglia_url_password: couchbase_monitored_buckets: diff --git a/couchbase/tasks/ganglia-plugin.yml b/couchbase/tasks/ganglia-plugin.yml index a4395281..695450fc 100644 --- a/couchbase/tasks/ganglia-plugin.yml +++ b/couchbase/tasks/ganglia-plugin.yml @@ -5,11 +5,27 @@ - name: Install the ganglia plugin for Couchbase. One instance per bucket template: src=couchbase.py.j2 dest=/usr/lib/ganglia/python_modules/couchbase_{{ item }}.py owner=root group=ganglia mode=0440 with_items: '{{ couchbase_monitored_buckets }}' + when: couchbase_ganglia_plugin_enabled notify: Restart ganglia monitor tags: [ 'ganglia', 'couchbase' ] - name: Distribute the ganglia (gmond) configuration for the Couchbase plugin template: src=couchbase.pyconf.j2 dest=/etc/ganglia/conf.d/couchbase_{{ item }}.pyconf owner=root group=ganglia mode=0440 with_items: '{{ couchbase_monitored_buckets }}' + when: couchbase_ganglia_plugin_enabled + notify: Restart ganglia monitor + tags: [ 'ganglia', 'couchbase' ] + +- name: Remove the ganglia (gmond) configuration for the Couchbase plugin when we want it disabled + file: dest=/etc/ganglia/conf.d/couchbase_{{ item }}.pyconf state=absent + with_items: '{{ couchbase_monitored_buckets }}' + when: not couchbase_ganglia_plugin_enabled + notify: Restart ganglia monitor + tags: [ 'ganglia', 'couchbase' ] + +- name: Remove the ganglia plugin for Couchbase when we want it disabled + file: dest=/usr/lib/ganglia/python_modules/couchbase_{{ item }}.py state=absent + with_items: '{{ couchbase_monitored_buckets }}' + when: not couchbase_ganglia_plugin_enabled notify: Restart ganglia monitor tags: [ 'ganglia', 'couchbase' ]