From: Guillaume Abrioux Date: Wed, 22 Jul 2020 14:08:15 +0000 (+0200) Subject: shrink_osd: remove osd data directory X-Git-Tag: v4.0.28~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8cf17750ee5f46c5e5773904eee6367fa54db548;p=ceph-ansible.git shrink_osd: remove osd data directory Otherwise it leaves an empty directory. When shrinking and redeploying multiple OSDs you have no guarantee it will reuse the same osd id. Signed-off-by: Guillaume Abrioux (cherry picked from commit 8933bfde33b8aa6ad6f0a0f29531699922d9bf75) --- diff --git a/infrastructure-playbooks/shrink-osd.yml b/infrastructure-playbooks/shrink-osd.yml index 23ab07cf3..d08db5c10 100644 --- a/infrastructure-playbooks/shrink-osd.yml +++ b/infrastructure-playbooks/shrink-osd.yml @@ -148,7 +148,7 @@ - name: umount osd lockbox mount: path: "/var/lib/ceph/osd-lockbox/{{ ceph_osd_data_json[item.2]['data']['uuid'] }}" - state: unmounted + state: absent loop: "{{ _osd_hosts }}" delegate_to: "{{ item.0 }}" when: @@ -160,12 +160,10 @@ - name: umount osd data mount: path: "/var/lib/ceph/osd/{{ cluster }}-{{ item.2 }}" - state: unmounted + state: absent loop: "{{ _osd_hosts }}" delegate_to: "{{ item.0 }}" - when: - - not containerized_deployment | bool - - item.2 not in _lvm_list.keys() + when: not containerized_deployment | bool - name: get parent device for data partition command: lsblk --noheadings --output PKNAME --nodeps "{{ ceph_osd_data_json[item.2]['data']['path'] }}" @@ -230,6 +228,13 @@ run_once: true with_items: "{{ osd_to_kill.split(',') }}" + - name: remove osd data dir + file: + path: "/var/lib/ceph/osd/{{ cluster }}-{{ item.2 }}" + state: absent + loop: "{{ _osd_hosts }}" + delegate_to: "{{ item.0 }}" + - name: show ceph health command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} -s"