From 09f3caedaaacd614de4024cce4032b4479e672d1 Mon Sep 17 00:00:00 2001
From: Mathieu Parent <mathieu.parent@insee.fr>
Date: Thu, 21 Sep 2023 09:20:20 +0200
Subject: [PATCH] [download] Don't fail on 304 Not Modified (#10452)

i.e when file was not modified since last download
---
 roles/download/tasks/download_file.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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