]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Make 'disable ssl for dashboard task' idempotent.
authorGeorge Shuklin <george.shuklin@gmail.com>
Mon, 13 Jul 2020 10:40:17 +0000 (13:40 +0300)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 20 Aug 2020 14:48:32 +0000 (16:48 +0200)
This should reduce number of 'changed' tasks during convergence test.

Signed-off-by: George Shuklin <george.shuklin@gmail.com>
roles/ceph-dashboard/tasks/configure_dashboard.yml

index 461d893d0efbbce105b6f031c1e0cdfe02993b8f..c561bdf282a4fe6bab89117a97c35577c1ea59bf 100644 (file)
@@ -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"