From 1a86b4cb6d17ab54a70b399b0cb834a2688c3a8c Mon Sep 17 00:00:00 2001
From: Romain <58464216+RomainMou@users.noreply.github.com>
Date: Thu, 4 Jan 2024 04:00:47 +0100
Subject: [PATCH] Fix download retry when get_url has no status_code. (#10613)

* Fix download retry when get_url has no status_code.

* Fix until clause in download role.
---
 roles/download/tasks/download_file.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/roles/download/tasks/download_file.yml b/roles/download/tasks/download_file.yml
index f7f308048..98b9487f5 100644
--- a/roles/download/tasks/download_file.yml
+++ b/roles/download/tasks/download_file.yml
@@ -103,7 +103,7 @@
     become: "{{ not download_localhost }}"
     until: "'OK' in get_url_result.msg or
       'file already exists' in get_url_result.msg or
-      get_url_result.status_code == 304"
+      get_url_result.status_code | default() == 304"
     retries: "{{ download_retries }}"
     delay: "{{ retry_stagger | default(5) }}"
     environment: "{{ proxy_env }}"
-- 
GitLab