In this post, we will see how to resolve ansible: Retry a task based on content of task’s result.stderr
Question:I am looking for a solution to the following situation: I automate machine provisioning in my homelab with the help of ansible. Given a poor network connection I want to make my playbooks a bit more robust against (short) network outages.
Now imagine a task like this:
Checking stderr to be present before accessing it might be an idea but I could not figure out how to do so in a untilcondition.
Do you have any idea?
Best Answer:Q: “This will raise an exception if the task completes without issues and stderr is not present.”
A: Use the filter default
If you have better answer, please add a comment about this, thank you!