From f607857f2a58b2ed14faf49f2b10d056a7f96b30 Mon Sep 17 00:00:00 2001 From: George Shuklin Date: Mon, 13 Jul 2020 13:40:17 +0300 Subject: [PATCH] Make 'disable ssl for dashboard task' idempotent. This should reduce number of 'changed' tasks during convergence test. Signed-off-by: George Shuklin (cherry picked from commit 73d4bb6bd6b560de7f2b3042bdc7d17c901e815a) --- .../ceph-dashboard/tasks/configure_dashboard.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/roles/ceph-dashboard/tasks/configure_dashboard.yml b/roles/ceph-dashboard/tasks/configure_dashboard.yml index 461d893d0..c561bdf28 100644 --- a/roles/ceph-dashboard/tasks/configure_dashboard.yml +++ b/roles/ceph-dashboard/tasks/configure_dashboard.yml @@ -5,10 +5,19 @@ when: containerized_deployment | bool - name: disable SSL for dashboard - command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} config set mgr mgr/dashboard/ssl false" - delegate_to: "{{ groups[mon_group_name][0] }}" - run_once: true when: dashboard_protocol == "http" + delegate_to: "{{ groups[mon_group_name][0] }}" + block: + - name: get SSL status for dashboard + run_once: true + command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} config get mgr mgr/dashboard/ssl" + changed_when: false + register: current_ssl_for_dashboard + + - name: disable SSL for dashboard + run_once: true + command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} config set mgr mgr/dashboard/ssl false" + when: current_ssl_for_dashboard.stdout == "true" - name: with SSL for dashboard when: dashboard_protocol == "https"