]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
purge-cluster: add a check for a device list
authorSébastien Han <seb@redhat.com>
Thu, 24 Mar 2016 10:38:56 +0000 (11:38 +0100)
committerSébastien Han <seb@redhat.com>
Thu, 24 Mar 2016 12:35:26 +0000 (13:35 +0100)
People who use `osd_auto_discovery` feature will not have a devices
variable populated, so we first check for the existence of devices.

Signed-off-by: Sébastien Han <seb@redhat.com>
purge-cluster.yml

index 0ac58b6810af8f56d1c1f45b35eaa9fec43c1785..63c4c7acbf12392fc34f5e89bf912228634af60a 100644 (file)
      state: absent
 
   tasks:
+  - name: check for a device list
+    fail:
+      msg: "OSD automatic discovery was detected, purge cluster does not support this scenario. If you want to purge the cluster, manually provide the list of devices in group_vars/osds using the devices variable."
+    when:
+      devices is not defined and
+      osd_auto_discovery
+
   - name: get osd numbers
     shell: "if [ -d /var/lib/ceph/osd ] ; then ls /var/lib/ceph/osd | cut -d '-' -f 2 ; fi"
     register: osd_ids