infra-playbooks: rewite a condition for better readability

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 5aecdd3ba6)
pull/4279/head
Rishabh Dave 2019-07-25 17:02:32 +05:30 committed by Guillaume Abrioux
parent 432257b6dd
commit 8ca88b41cc
2 changed files with 2 additions and 4 deletions

View 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

View 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