]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
lint: fix error [301], add `changed_when: false` when needed
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 31 Jul 2019 07:51:12 +0000 (09:51 +0200)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Wed, 28 Aug 2019 15:22:47 +0000 (11:22 -0400)
This commit fixes the error [301]:

`[301] Commands should not change things if nothing needs doing`

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 327d5641063e5a435e53ecb95148dca3c099b930)

roles/ceph-dashboard/tasks/configure_dashboard.yml
roles/ceph-mgr/tasks/mgr_modules.yml

index 28ce815f79c77bd84d431fe82a29249d52da17a3..f389eb0549f6ba6953e25e7b5a9cc50f7e71371f 100644 (file)
@@ -62,6 +62,7 @@
 
 - name: "set the dashboard port ({{ dashboard_port }})"
   command: "{{ container_exec_cmd }} ceph config set mgr mgr/dashboard/server_port {{ dashboard_port }}"
+  changed_when: false
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
 
@@ -69,6 +70,8 @@
   command: "{{ container_exec_cmd }} ceph config set mgr mgr/dashboard/ssl_server_port {{ dashboard_port }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
+  changed_when: false
+  failed_when: false # Do not fail if the option does not exist, it only exists post-14.2.0
 
 - name: disable mgr dashboard module (restart)
   command: "{{ container_exec_cmd }} ceph mgr module disable dashboard"
@@ -94,6 +97,7 @@
   register: ac_result
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
+  changed_when: false
   until: ac_result.rc == 0
 
 - name: set grafana url
index fdfbe20de3135c6e2f8a5f1f062c3b4d896f5d9c..8c0634421f802fbb4fa6824ba9bde6a7ac1c0e4c 100644 (file)
@@ -10,6 +10,7 @@
   retries: 30
   delay: 5
   delegate_to: "{{ groups[mon_group_name][0] }}"
+  changed_when: false
   until:
     - mgr_dump.rc == 0
     - (mgr_dump.stdout | from_json).available | bool