]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
testnode: Shred any leftover ceph osd metadata on non-root partitions
authorDavid Galloway <dgallowa@redhat.com>
Thu, 6 Jul 2017 21:04:15 +0000 (17:04 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Fri, 7 Jul 2017 15:20:09 +0000 (11:20 -0400)
Fixes: http://tracker.ceph.com/issues/20533
Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/testnode/tasks/zap_disks.yml

index 8b7f1d8149d557b57613276a5c670e08fa378c4a..8e3931d4ff32a5de49074ba095c4f5942a95ba1d 100644 (file)
   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 }}"