Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
"retries" without "until": retry until success #20802
OS / ENVIRONMENT
At the moment, giving "retries:" without an "until:" condition has no effect.
It would be useful if this could be implemented to mean "retry until success"
(Or if not, at least generate an error saying that
STEPS TO REPRODUCE
- hosts: localhost tasks: - file: path=/tmp/zzz state=absent - name: testing timeout get_url: url: http://126.96.36.199/zzz dest: /tmp/zzz retries: 2 delay: 3
The module is retried 2 times.
The module is run only once.
To get the desired behaviour you have to add three lines:
But an unfortunate side-effect of
So you need to add another task, something like this:
This is pretty messy when all you wanted to do is say "if this task fails, retry it up to N times and then give up"
Jan 30, 2017
Yup, this just happened to me on Ansible 2.3. The run failed and aborted instead of retrying (I didn't set
Is this maybe solved now using the
I have (so far) successfully migrated my tasks into
I have retested with ansible 2.5, and now the "ignore_errors:" part is no longer needed.
So the following works correctly, in both success and failure situations:
There is no benefit from adding
It's better than it was, but I still think the default for
@woqer: what exactly is still happening? Can you provide a sample playbook?
The playbook I just posted was tested with ansible
It shows that you still need an
Yes please do, it was very confusing. At the very least implement an error: For example the api.ipify.org fails sometimes so I tried:
That doesn't work but doesn't generate an error or anything.
referenced this issue
May 6, 2019
A user just wasted a few hours on that until we finally realised what was happening.
At this point, it seems to be lost in merging, various blabla about it, and the issue is not addressed.
Can someone clarify the status?