]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Update: Avoid screen scraping in rolling update
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 11 Jul 2017 13:36:01 +0000 (15:36 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 12 Jul 2017 13:02:39 +0000 (15:02 +0200)
since luminous has revamped the `ceph -s` output, we need to avoid screen
scraping.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
infrastructure-playbooks/rolling_update.yml

index 30acaba8838511f5c02787b2314aab57c4ebf53b..79a32317fa0ae67785fea42ee853589376fa2244 100644 (file)
 
     - name: waiting for the monitor to join the quorum...
       shell: |
-        ceph -s --cluster {{ cluster }} | grep election | sed 's/.*quorum//' | egrep -sq {{ ansible_hostname }}
+        ceph --cluster {{ cluster }} -s -f json | python -c 'import sys, json; print(json.load(sys.stdin)["quorum_names"])'
       register: result
-      until: result.rc == 0
+      until: "{{ ansible_hostname in result.stdout }}"
       retries: "{{ health_mon_check_retries }}"
       delay: "{{ health_mon_check_delay }}"
       delegate_to: "{{ mon_host }}"
 
     - name: waiting for the containerized monitor to join the quorum...
       shell: |
-        docker exec ceph-mon-{{ hostvars[mon_host]['ansible_hostname'] }} ceph -s --cluster {{ cluster }} | grep quorum | sed 's/.*quorum//' | egrep -sq {{ ansible_hostname }}
+        docker exec ceph-mon-{{ hostvars[mon_host]['ansible_hostname'] }} ceph --cluster {{ cluster }} -s -f json | python -c 'import sys, json; print(json.load(sys.stdin)["quorum_names"])'
       register: result
-      until: result.rc == 0
+      until: "{{ ansible_hostname in result.stdout }}"
       retries: "{{ health_mon_check_retries }}"
       delay: "{{ health_mon_check_delay }}"
       delegate_to: "{{ mon_host }}"