From: Ramana Raja Date: Mon, 3 Dec 2018 14:25:42 +0000 (+0530) Subject: rolling_update: fail if less than 3 MONs X-Git-Tag: v3.2.0rc8~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0ec2ac34e3f7e08fbd4b379f872ffa7d7f724ef1;p=ceph-ansible.git rolling_update: fail if less than 3 MONs ... for non-containerized deployments as well. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1655470 Signed-off-by: Ramana Raja (cherry picked from commit cb784c601d2063b95fb7d2514e39518137164e12) --- diff --git a/infrastructure-playbooks/rolling_update.yml b/infrastructure-playbooks/rolling_update.yml index b655c6d70..c1969f7d7 100644 --- a/infrastructure-playbooks/rolling_update.yml +++ b/infrastructure-playbooks/rolling_update.yml @@ -95,15 +95,11 @@ - name: set mon_host_count set_fact: mon_host_count={{ groups[mon_group_name] | length }} - - debug: msg="WARNING - upgrading a ceph cluster with only one monitor node ({{ inventory_hostname }})" - when: mon_host_count | int == 1 - - - name: fail when single containerized monitor + - name: fail when less than three monitors fail: - msg: "Upgrades of a single monitor are not supported, also running 1 monitor is not recommended always use 3." + msg: "Upgrade of cluster with less than three monitors is not supported." when: - - containerized_deployment - - mon_host_count | int == 1 + - mon_host_count | int < 3 - name: stop ceph mon - shortname systemd: @@ -152,9 +148,9 @@ - name: set mon_host_count set_fact: mon_host_count={{ groups[mon_group_name] | length }} - - name: select a running monitor if multiple monitors + - name: select a running monitor set_fact: - mon_host: "{{ groups[mon_group_name] | difference([inventory_hostname]) | last if mon_host_count > 1 else groups[mon_group_name] | last }}" + mon_host: "{{ groups[mon_group_name] | difference([inventory_hostname]) | last }}" - name: non container | waiting for the monitor to join the quorum... command: ceph --cluster "{{ cluster }}" -s --format json