]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
[shrink-mon]: force playbook to fail if there is only one mon 1118/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 24 Nov 2016 21:46:46 +0000 (22:46 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Fri, 25 Nov 2016 10:20:11 +0000 (11:20 +0100)
The playbook will fail if only 1 mon is in the cluster
and advise to use the `purge-cluster` playbook instead.

Fix #1083

infrastructure-playbooks/shrink-mon.yml

index cca6c6b45a8892827e6730dd14a8d07ccc71644e..625e8000250ecd553f393ccf8bb36fa9b42bbd24 100644 (file)
   - include_vars: roles/ceph-common/defaults/main.yml
   - include_vars: group_vars/all.yml
 
+  - name: exit playbook, if only one monitor is present in cluster
+    fail:
+      msg: "You are about to shrink the only monitor present in the cluster.
+            If you really want to do that, please use the purge-cluster playbook."
+    when: "{{ groups[mon_group_name] | length | int == 1 }}"
+
   - name: exit playbook, if user did not mean to shrink cluster
     fail:
       msg: "Exiting shrink-mon playbook, no monitor(s) was/were removed.