From: David Galloway Date: Fri, 7 Jul 2017 15:22:09 +0000 (-0400) Subject: testnode: Retry zapping disk if sgdisk fails the first time X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F323%2Fhead;p=ceph-cm-ansible.git testnode: Retry zapping disk if sgdisk fails the first time 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 --- diff --git a/roles/testnode/tasks/zap_disks.yml b/roles/testnode/tasks/zap_disks.yml index 8e3931d..d3ad034 100644 --- a/roles/testnode/tasks/zap_disks.yml +++ b/roles/testnode/tasks/zap_disks.yml @@ -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