]> 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, 20 Dec 2018 13:03:30 +0000 (14:03 +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>
(cherry picked from commit ffd56177e7616ba6345f1f1cc1f3b3e6ea7d66f3)

infrastructure-playbooks/purge-cluster.yml

index daa6b812b220ec544e644c270b793e280f62d347..d40353e048515248ba3caa72d2846380fe17960e 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: |