-
Notifications
You must be signed in to change notification settings - Fork 23.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"retries" without "until": retry until success #20802
Comments
The `retries` statement is just ignored unless an `until` clause is provided. ansible/ansible#20802
The `retries` statement is just ignored unless an `until` clause is provided. ansible/ansible#20802
The `retries` statement is just ignored unless an `until` clause is provided. ansible/ansible#20802
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 |
A complete example of what I changed it into to get it to work:
|
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 Specifying It's better than it was, but I still think the default for |
I believe this is still happening on 2.5 |
@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 |
@candlerb you still need |
|
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. |
Hello, 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? |
The point of this issue is to determine what happens when |
Ok but is there anyone working on ensuring that there's at least a warning when there's only "reply" and no "until"? So that the user can see it's ignored? |
This will be addressed with this PR: #43128 |
Trying a different approach from the previous wait_timeout, which wasn't working. This approach was suggested here: <ansible/ansible#20802>. BLUEBUTTON-1112
Removing the |
I just ran into the same thing where I added retries expecting it to retry if there was a failure, but since I didn't have an |
ISSUE TYPE
COMPONENT NAME
retries
ANSIBLE VERSION
CONFIGURATION
N/A
OS / ENVIRONMENT
N/A
SUMMARY
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
retries
has no effect withoutuntil
)STEPS TO REPRODUCE
EXPECTED RESULTS
The module is retried 2 times.
ACTUAL RESULTS
The module is run only once.
To get the desired behaviour you have to add three lines:
But an unfortunate side-effect of
ignore_errors
is that a failure even after all the retries is ignored: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"
The text was updated successfully, but these errors were encountered: