I have an ansible
playbook running on many machines. In that playbook I have a few packages I am trying to install using apt
, but occasionally they fail, either because other playbooks are running, a periodic update or any other apt
instance running in parallel and grabbing the lock.
I basically want to add a retry loop before giving up but failed to do so as retries is not supported for apt
, apparently: I looked into the apt module
page in ansible's documentation, and even tried to actually use it even though it is not there (which obviously failed).
Anyway - I need an idea on how to get ansible to retry for let's say 3 times, with 30 seconds delay, but only on failures to install the package.