From ffd56177e7616ba6345f1f1cc1f3b3e6ea7d66f3 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Tue, 11 Dec 2018 10:52:26 -0600 Subject: [PATCH] purge-cluster: skip tasks that use ceph-volume if it's not installed This will allow the playbook to be idempotent. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1656935 Signed-off-by: Andrew Schoen --- infrastructure-playbooks/purge-cluster.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/infrastructure-playbooks/purge-cluster.yml b/infrastructure-playbooks/purge-cluster.yml index 346a22e80..2e918e3ee 100644 --- a/infrastructure-playbooks/purge-cluster.yml +++ b/infrastructure-playbooks/purge-cluster.yml @@ -303,6 +303,11 @@ failed_when: false register: ceph_lockbox_partition_to_erase_path + - name: see if ceph-volume is installed + command: "command -v ceph-volume" + failed_when: false + register: ceph_volume_present + - name: zap and destroy osds created by ceph-volume with lvm_volumes ceph_volume: data: "{{ item.data }}" @@ -319,6 +324,7 @@ with_items: "{{ lvm_volumes }}" when: - osd_scenario == "lvm" + - ceph_volume_present.rc == 0 - name: zap and destroy osds created by ceph-volume with devices ceph_volume: @@ -329,6 +335,7 @@ with_items: "{{ devices | default([]) }}" when: - osd_scenario == "lvm" + - ceph_volume_present.rc == 0 - name: get ceph block partitions shell: | -- 2.39.5