Has anyone ever seen retries work on an ansible win_chocolatey task?
The follow seems to fail on the first attempt with no retries and I'm getting timeouts at the ansible level while choco attempts to install a package.
- name: Install Chocolatey
win_chocolatey:
name: a_package
env: choco
retries: 3
Have you successfully used retries with win_chocolatey tasks?
Possible Solution Using Henrik's suggestion and a block, I have retries plus a rescue/catch operation to fetch the choco log in case of errors after retries
- name: install applications
block:
- win_chocolatey:
name: "{{ item }}"
source: "{{ choco_artifactory_source }}"
register: result
until: result.rc == 0
retries: 3
with_items:
- wget
- curl
rescue:
- fetch:
src: "{{ choco_log }}"
dest: "{{ agent_log_dir }}"
flat: yes
There is no
until
parameter defined, thusapplies.
See the documentation for do-until loops for more information.