]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
purge-cluster: skip tasks that use ceph-volume if it's not installed
authorAndrew Schoen <aschoen@redhat.com>
Tue, 11 Dec 2018 16:52:26 +0000 (10:52 -0600)
committerSébastien Han <seb@redhat.com>
Thu, 13 Dec 2018 10:27:27 +0000 (11:27 +0100)
This will allow the playbook to be idempotent.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1656935
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
infrastructure-playbooks/purge-cluster.yml

index 346a22e8085a67beaa20ccf7b79bd923f0aa1b38..2e918e3ee33c18c7e7654990526452bd1c5d2590 100644 (file)
     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 }}"
     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:
     with_items: "{{ devices | default([]) }}"
     when:
       - osd_scenario == "lvm"
+      - ceph_volume_present.rc == 0
 
   - name: get ceph block partitions
     shell: |