From 77c5d6b2f65b35b686e3b3aa7d2737f0a71853b9 Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Wed, 20 Nov 2024 11:02:50 +0300 Subject: [PATCH 1/2] PMM-7 Better grafana start/stop handler --- build/ansible/roles/dashboards/tasks/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/ansible/roles/dashboards/tasks/main.yml b/build/ansible/roles/dashboards/tasks/main.yml index fdf0effcc1..76676df1b8 100644 --- a/build/ansible/roles/dashboards/tasks/main.yml +++ b/build/ansible/roles/dashboards/tasks/main.yml @@ -6,6 +6,7 @@ become: true become_user: pmm become_method: su + register: stop_grafana - name: Retrieve Percona plugins find: @@ -50,3 +51,4 @@ become: true become_user: pmm become_method: su + when: stop_grafana.changed == true From a968931c4f17a1d9a17677f25efa7d178d7863f0 Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Wed, 20 Nov 2024 12:33:27 +0300 Subject: [PATCH 2/2] PMM-13483 Fix 'Restart Grafana with new plugins' --- build/ansible/roles/dashboards/tasks/main.yml | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/build/ansible/roles/dashboards/tasks/main.yml b/build/ansible/roles/dashboards/tasks/main.yml index 76676df1b8..c43984663d 100644 --- a/build/ansible/roles/dashboards/tasks/main.yml +++ b/build/ansible/roles/dashboards/tasks/main.yml @@ -1,13 +1,4 @@ --- -- name: Stop Grafana - community.general.supervisorctl: - name: grafana - state: stopped - become: true - become_user: pmm - become_method: su - register: stop_grafana - - name: Retrieve Percona plugins find: paths: /usr/share/percona-dashboards/panels/ @@ -44,11 +35,12 @@ mode: 0644 remote_src: yes -- name: Start Grafana - community.general.supervisorctl: - name: grafana - state: started +- name: Restart Grafana service with new plugins + shell: "supervisorctl {{ item }} grafana" become: true become_user: pmm become_method: su - when: stop_grafana.changed == true + loop: + - stop + - remove + - add