]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
infra-playbooks: rewite a condition for better readability
authorRishabh Dave <ridave@redhat.com>
Thu, 25 Jul 2019 11:32:32 +0000 (17:02 +0530)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 29 Jul 2019 13:52:29 +0000 (15:52 +0200)
Use facility built-in in Ansible to check whether a command was executed
successfully rather looking at its return value.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
(cherry picked from commit 5aecdd3ba6e67019eda7adcfa6bb5f2a3cce5081)

infrastructure-playbooks/shrink-mgr.yml
infrastructure-playbooks/shrink-rbdmirror.yml

index 4457c651e72f2870ab040e8f9004f0c44a2654dd..4063b6fded6a8992bd63982def03ed64956b65d6 100644 (file)
@@ -43,8 +43,7 @@
     - name: exit playbook, if can not connect to the cluster
       command: "{{ container_exec_cmd | default('') }} timeout 5 ceph --cluster {{ cluster }} health"
       register: ceph_health
-      until: ceph_health.rc
-      failed_when: ceph_health.rc != 0
+      until: ceph_health is succeeded
       delegate_to: "{{ groups[mon_group_name][0] }}"
       retries: 5
       delay: 2
index 85f893d9f328f39810a96db949bb29a59aa7cfed..ba0a18be2c01d03e974ee7180d091e08fead6ab9 100644 (file)
@@ -68,8 +68,7 @@
     - name: exit playbook, if can not connect to the cluster
       command: "{{ container_exec_cmd | default('') }} timeout 5 ceph --cluster {{ cluster }} -s -f json"
       register: ceph_health
-      until: ceph_health.rc
-      failed_when: ceph_health.rc != 0
+      until: ceph_health is succeeded
       delegate_to: "{{ groups[mon_group_name][0] }}"
       retries: 5
       delay: 2