Sometimes when using win_get_url, it fails with my downloads with
fatal: []: UNREACHABLE! => {"changed": false, "msg": "ssl: (u'http', u'Bad HTTP response returned from server. Code 500')", "unreachable": true}
As you can imagine, after an hour or so of building this is a bit annoying...
How would you encapsulate the win_get_url command to retry N times on failures like these?
--------
I've tried something along the lines of:
- name: win | Download packages
win_get_url:
url: "{{ item.url }}"
dest: "{{ tmp_working_dir }}/{{ item.name }}" timeout: 600
with_items: "{{ install_packages }}"
retries: 3
delay: 5
register: package_result
until: package_result|succeeded
ignore_errors: yes
- name: win | Report errors with downloading files
fail:
msg: "Unable to download {{ package_result.url }}: {{ package_result.response|default(package_result.msg) }}"
when: not package_result|succeeded
But even if it fails, it doesn't retry and exits.
Can anyone point to where I've made an error?