diff --git a/roles/download/tasks/download_file.yml b/roles/download/tasks/download_file.yml
index f7f30804846cbe7fb639abf644ddf42be42947cb..98b9487f51130620cb1cf07340990367468b4715 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 }}"