From d9fb812029874144f319e548e3176abc7b912ded Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Thu, 24 Mar 2016 11:38:56 +0100 Subject: [PATCH] purge-cluster: add a check for a device list MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- purge-cluster.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/purge-cluster.yml b/purge-cluster.yml index 0ac58b681..63c4c7acb 100644 --- a/purge-cluster.yml +++ b/purge-cluster.yml @@ -59,6 +59,13 @@ 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 -- 2.39.5