From 6230971b9297f67ff92e61a9a6e9203b499d6587 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Thu, 25 Mar 2021 09:34:28 +0100 Subject: [PATCH] gnocchi: fix external ceph integration when gnocchi-statsd is disabled Closes-Bug: #1926914 Change-Id: I7f472a27eb9f2e1f267d7c4bac22236cdd076322 --- ansible/roles/gnocchi/tasks/external_ceph.yml | 37 +++++++++---------- .../fix-gnocchi-statsd-a56c789a3da758a6.yaml | 5 +++ 2 files changed, 22 insertions(+), 20 deletions(-) create mode 100644 releasenotes/notes/fix-gnocchi-statsd-a56c789a3da758a6.yaml diff --git a/ansible/roles/gnocchi/tasks/external_ceph.yml b/ansible/roles/gnocchi/tasks/external_ceph.yml index 780f8ce584..01df7b167b 100644 --- a/ansible/roles/gnocchi/tasks/external_ceph.yml +++ b/ansible/roles/gnocchi/tasks/external_ceph.yml @@ -2,40 +2,37 @@ - name: Copy over ceph.conf file template: src: "{{ node_custom_config }}/gnocchi/ceph.conf" - dest: "{{ node_config_directory }}/{{ item }}/ceph.conf" + dest: "{{ node_config_directory }}/{{ item.key }}/ceph.conf" mode: "0660" become: true - when: inventory_hostname in groups[item] - with_items: - - "gnocchi-api" - - "gnocchi-metricd" - - "gnocchi-statsd" + when: + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool + with_dict: "{{ gnocchi_services }}" notify: - - Restart {{ item }} container + - Restart {{ item.key }} container - name: Copy over ceph gnocchi keyring copy: src: "{{ node_custom_config }}/gnocchi/{{ ceph_gnocchi_keyring }}" - dest: "{{ node_config_directory }}/{{ item }}/{{ ceph_gnocchi_keyring }}" + dest: "{{ node_config_directory }}/{{ item.key }}/{{ ceph_gnocchi_keyring }}" mode: "0660" become: true - when: inventory_hostname in groups[item] - with_items: - - "gnocchi-api" - - "gnocchi-metricd" - - "gnocchi-statsd" + when: + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool + with_dict: "{{ gnocchi_services }}" notify: - - Restart {{ item }} container + - Restart {{ item.key }} container - name: Ensuring config directory has correct owner and permission become: true file: - path: "{{ node_config_directory }}/{{ item }}" + path: "{{ node_config_directory }}/{{ item.key }}" recurse: yes owner: "{{ config_owner_user }}" group: "{{ config_owner_group }}" - when: inventory_hostname in groups[item] - with_items: - - "gnocchi-api" - - "gnocchi-metricd" - - "gnocchi-statsd" + when: + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool + with_dict: "{{ gnocchi_services }}" diff --git a/releasenotes/notes/fix-gnocchi-statsd-a56c789a3da758a6.yaml b/releasenotes/notes/fix-gnocchi-statsd-a56c789a3da758a6.yaml new file mode 100644 index 0000000000..69d9cbb64b --- /dev/null +++ b/releasenotes/notes/fix-gnocchi-statsd-a56c789a3da758a6.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixes an issue with Gnocchi when gnocchi-statsd is disabled. + `LP#1926914 `__