From 102f98e028c0416b65e60765281d2c9c91b71d24 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Fri, 7 Jul 2017 11:22:09 -0400 Subject: [PATCH] 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 --- roles/testnode/tasks/zap_disks.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/testnode/tasks/zap_disks.yml b/roles/testnode/tasks/zap_disks.yml index 8e3931d4..d3ad034b 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 -- 2.47.3