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
- 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"
- 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
- name: request data removal
local_action: shell echo requesting data removal
+ become: false
notify:
- remove data