]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
testnode: Retry zapping disk if sgdisk fails the first time 323/head
authorDavid Galloway <dgallowa@redhat.com>
Fri, 7 Jul 2017 15:22:09 +0000 (11:22 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Mon, 10 Jul 2017 19:16:36 +0000 (15:16 -0400)
I've seen `sgdisk -Z` fail the first time on RMA replacement drives from HGST but succeed on re-running it.

@alfredodeza recommended we add a retry.  Can't hurt.

Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/testnode/tasks/zap_disks.yml

index 8e3931d4ff32a5de49074ba095c4f5942a95ba1d..d3ad034bae0ecc71b530c0fe4c4bd7eb2d184819 100644 (file)
@@ -20,7 +20,8 @@
   with_items: "{{ non_root_partitions.stdout_lines }}"
   when: non_root_partitions|length > 0
 
+## See https://github.com/ceph/ceph-ansible/issues/759#issue-153248281
 - name: Zap all non-root disks
-  command: sgdisk --zap-all "/dev/{{ item.key }}"
+  shell: "sgdisk --zap-all /dev/{{ item.key }} || sgdisk --zap-all /dev/{{ item.key }}"
   with_dict: "{{ ansible_devices }}"
   when: item.key not in root_disk