From: David Galloway Date: Thu, 6 Jul 2017 21:04:15 +0000 (-0400) Subject: testnode: Shred any leftover ceph osd metadata on non-root partitions X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=954bea3657112c76f2da20668183ba3995b9267f;p=ceph-cm-ansible.git testnode: Shred any leftover ceph osd metadata on non-root partitions Fixes: http://tracker.ceph.com/issues/20533 Signed-off-by: David Galloway --- diff --git a/roles/testnode/tasks/zap_disks.yml b/roles/testnode/tasks/zap_disks.yml index 8b7f1d8..8e3931d 100644 --- a/roles/testnode/tasks/zap_disks.yml +++ b/roles/testnode/tasks/zap_disks.yml @@ -10,6 +10,16 @@ with_items: "{{ ansible_mounts }}" when: item.mount == '/' +- name: Compile list of non-root partitions + shell: "lsblk --list --noheadings | grep part | grep -v {{ root_disk|regex_replace('/dev/', '') }} | awk '{ print $1 }'" + register: non_root_partitions + +## http://tracker.ceph.com/issues/20533 +- name: Wipe filesystems on non-root partitions + shell: "wipefs --force --all /dev/{{ item }}" + with_items: "{{ non_root_partitions.stdout_lines }}" + when: non_root_partitions|length > 0 + - name: Zap all non-root disks command: sgdisk --zap-all "/dev/{{ item.key }}" with_dict: "{{ ansible_devices }}"