From 9b8ed55abe936e99d6dec726b41266284a149943 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Thu, 20 Apr 2023 10:25:36 +0100 Subject: [PATCH] Add retries to get_url and uri tasks These tasks occasionally fail in CI, causing jobs to fail. Change-Id: I89041a641d8cb66c7848fa9ae9264a51aa1e38c8 (cherry picked from commit 2951f26ad1d6d79671f5f94016468af3c43e6143) --- ansible/roles/apt/tasks/keys.yml | 4 ++++ ansible/roles/dell-switch-bmp/tasks/main.yml | 4 ++++ ansible/roles/image-download/tasks/main.yml | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/ansible/roles/apt/tasks/keys.yml b/ansible/roles/apt/tasks/keys.yml index 4c1cda1e0..4b04e824b 100644 --- a/ansible/roles/apt/tasks/keys.yml +++ b/ansible/roles/apt/tasks/keys.yml @@ -17,3 +17,7 @@ mode: 0644 loop: "{{ apt_keys }}" become: true + register: result + until: result is successful + retries: 3 + delay: 5 diff --git a/ansible/roles/dell-switch-bmp/tasks/main.yml b/ansible/roles/dell-switch-bmp/tasks/main.yml index cc7e65894..c02a5a8bc 100644 --- a/ansible/roles/dell-switch-bmp/tasks/main.yml +++ b/ansible/roles/dell-switch-bmp/tasks/main.yml @@ -20,3 +20,7 @@ notify: - Copy Dell switch BMP images become: True + register: result + until: result is successful + retries: 3 + delay: 5 diff --git a/ansible/roles/image-download/tasks/main.yml b/ansible/roles/image-download/tasks/main.yml index 3f905b8bf..85a418ac8 100644 --- a/ansible/roles/image-download/tasks/main.yml +++ b/ansible/roles/image-download/tasks/main.yml @@ -12,6 +12,9 @@ url: "{{ image_download_checksum_url }}" return_content: true register: expected_checksum + until: expected_checksum is successful + retries: 3 + delay: 5 when: - image_download_checksum_url is not none - image_download_checksum_url != "" @@ -29,6 +32,10 @@ # Always download the image if we have no checksum to compare with. force: "{{ expected_checksum is skipped }}" backup: true + register: result + until: result is successful + retries: 3 + delay: 5 when: - image_download_url is not none - image_download_url != ""