]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
rolling_update: clarify mon quorum command 1959/head
authorSébastien Han <seb@redhat.com>
Thu, 28 Sep 2017 22:10:57 +0000 (00:10 +0200)
committerSébastien Han <seb@redhat.com>
Thu, 28 Sep 2017 23:19:46 +0000 (01:19 +0200)
Cleaner.

Signed-off-by: Sébastien Han <seb@redhat.com>
infrastructure-playbooks/rolling_update.yml

index 93f1d5d83aac4be8709f821872b2972e59948b77..0040fed554690c96cef3050f90f657be606b3838 100644 (file)
         - mon_host_count | int == 1
 
     - name: waiting for the monitor to join the quorum...
-      shell: |
-        ceph --cluster {{ cluster }} -s -f json | python -c 'import sys, json; print(json.load(sys.stdin)["quorum_names"])'
-      register: result
-      until: "{{ ansible_hostname in result.stdout }}"
+      command: ceph --cluster "{{ cluster }}" -s --format json
+      register: ceph_health_raw
+      until: >
+        hostvars[mon_host]['ansible_hostname'] in (ceph_health_raw.stdout | from_json)["quorum_names"]
       retries: "{{ health_mon_check_retries }}"
       delay: "{{ health_mon_check_delay }}"
       delegate_to: "{{ mon_host }}"
-      when: not containerized_deployment
+      when:
+        - not containerized_deployment
 
     - name: waiting for the containerized monitor to join the quorum...
-      shell: |
-        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: "{{ ansible_hostname in result.stdout }}"
+      command: docker exec ceph-mon-{{ hostvars[mon_host]['ansible_hostname'] }} ceph --cluster "{{ cluster }}" -s --format json
+      register: ceph_health_raw
+      until: >
+        hostvars[mon_host]['ansible_hostname'] in (ceph_health_raw.stdout | from_json)["quorum_names"]
       retries: "{{ health_mon_check_retries }}"
       delay: "{{ health_mon_check_delay }}"
       delegate_to: "{{ mon_host }}"
-      when: containerized_deployment
+      when:
+        - containerized_deployment
 
     - name: set osd flags
       command: ceph osd set {{ item }} --cluster {{ cluster }}
       command: ceph --cluster {{ cluster }} versions
       register: ceph_versions
       delegate_to: "{{ groups[mon_group_name][0] }}"
+      when: not containerized_deployment
+
+    - name: containers - get osd versions
+      command: |
+        docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} versions
+      register: ceph_versions
+      delegate_to: "{{ groups[mon_group_name][0] }}"
+      when: containerized_deployment
 
     - name: set_fact ceph_versions_osd
       set_fact:
       command: ceph --cluster {{ cluster }} osd require-osd-release luminous
       delegate_to: "{{ groups[mon_group_name][0] }}"
       when:
+        - not containerized_deployment
         - (ceph_versions.stdout|from_json).osd | length == 1
         - ceph_versions_osd | string | search("ceph version 12")
 
+    - name: containers - complete osds upgrade
+      command: |
+        docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} osd require-osd-release luminous
+      delegate_to: "{{ groups[mon_group_name][0] }}"
+      when:
+        - containerized_deployment
+        - (ceph_versions.stdout|from_json).osd | length == 1
+        - ceph_versions_osd | string | search("ceph version 12")
 
 - name: upgrade ceph mdss cluster