diff --git a/purge-cluster.yml b/purge-cluster.yml index b2c8c9473..ab2b8ec13 100644 --- a/purge-cluster.yml +++ b/purge-cluster.yml @@ -293,15 +293,18 @@ osd_group_name in group_names - name: remove osd mountpoint tree - shell: rm -rf /var/lib/ceph/osd + file: + path: /var/lib/ceph/osd/ + state: absent register: remove_osd_mountpoints - failed_when: false + ignore_errors: true when: osd_group_name in group_names - name: remove monitor store and bootstrap keys - shell: rm -rf /var/lib/ceph/ - failed_when: false + file: + path: /var/lib/ceph/ + state: absent when: mon_group_name in group_names @@ -313,7 +316,7 @@ - remove data when: osd_group_name in group_names and - remove_osd_mountpoints.rc != 0 + remove_osd_mountpoints.failed is defined - name: see if ceph-disk is installed shell: "which ceph-disk" @@ -322,7 +325,7 @@ - name: zap osd disks shell: ceph-disk zap "{{ item }}" - with_items: devices + with_items: "{{ devices | default([]) }}" when: osd_group_name in group_names and ceph_disk_present.rc == 0 and @@ -423,6 +426,7 @@ - name: request data removal local_action: shell echo requesting data removal + become: false notify: - remove data