I have ansible games running on many machines. In this playbook, I have several packages that I try to install using apt , but sometimes they fail, either due to the launch of other playbooks, periodic updates, or any other apt instance running in parallel and lock capture.
I basically want to add a repetition loop before giving up, but I couldn’t do it, because repetitions are not supported for apt , apparently: I looked at the apt module page in the ANSI documentation and even tried to actually use it, although it is there no (which obviously failed).
In any case, I need an idea on how to configure ANSI to retry, say, 3 times, with a delay of 30 seconds, but only if the package installation fails.
source share