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>
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