]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Warn user when upgrading cluster with only one mon
authorIvan Font <ifont@redhat.com>
Mon, 14 Nov 2016 19:04:43 +0000 (11:04 -0800)
committerIvan Font <ifont@redhat.com>
Thu, 17 Nov 2016 19:25:25 +0000 (11:25 -0800)
Signed-off-by: Ivan Font <ifont@redhat.com>
infrastructure-playbooks/rolling_update.yml

index 9f8394c0812e8e77b0a90354aec4d035d907b722..a5b31432c6433a8ed0c287be46c991392f37f8af 100644 (file)
@@ -24,7 +24,7 @@
       msg: >
         "Exiting rolling_update.yml playbook, cluster was NOT upgraded.
          To upgrade the cluster, either say 'yes' on the prompt or
-         or use `-e ireallymeanit=yes` on the command line when
+         use `-e ireallymeanit=yes` on the command line when
          invoking the playbook"
     when: ireallymeanit != 'yes'
 
@@ -62,7 +62,6 @@
       command: grep -sq systemd /proc/1/comm
       register: is_systemd
 
-
 - name: upgrade ceph mon cluster
 
   vars:
   become: True
 
   pre_tasks:
+    - name: set mon_host_count
+      set_fact: mon_host_count={{ groups.mons | length }}
+
+    - debug: msg="WARNING - upgrading a Ceph cluster with only one monitor node ({{ inventory_hostname }})"
+      when: mon_host_count | int == 1
+
     - name: stop ceph mons with upstart
       service:
         name: ceph-mon
 
     - name: waiting for the monitor to join the quorum...
       shell: |
-        ceph -s  --cluster {{ cluster }} | grep monmap | sed 's/.*quorum//' | egrep -sq {{ ansible_hostname }}
+        ceph -s --cluster {{ cluster }} | grep monmap | sed 's/.*quorum//' | egrep -sq {{ ansible_hostname }}
       register: result
       until: result.rc == 0
       retries: "{{ health_mon_check_retries }}"
 
     - name: waiting for the containerized monitor to join the quorum...
       shell: |
-        docker exec {{ hostvars[mon_host]['ansible_hostname'] }} ceph -s  --cluster {{ cluster }} | grep quorum | sed 's/.*quorum//' | egrep -sq {{ ansible_hostname }}
+        docker exec {{ hostvars[mon_host]['ansible_hostname'] }} ceph -s --cluster {{ cluster }} | grep quorum | sed 's/.*quorum//' | egrep -sq {{ ansible_hostname }}
       register: result
       until: result.rc == 0
       retries: "{{ health_mon_check_retries }}"
         name: ceph-osd@{{ item | basename }}
         state: restarted
         enabled: yes
-      with_items: ceph_osd_docker_devices
+      with_items: "{{ ceph_osd_docker_devices }}"
       when:
         - is_systemd
         - osd_containerized_deployment