In my Ansible play I am restarting database then trying to do some operations on it. Restart command returns as soon as restart is started, not when db is up. Next command tries to connect to the database. That command my fail when db is not up.
I want to retry my second command a few times. If last retry fails, I want to fail my play.
When I do retries as follows
retries: 3
delay: 5
Then retries are not executed at all, because first command execution fails whole play. I could add ignore_errors: yes
but that way play will pass even if all retries failed. Is there a easy way to retry failures until I have success, but fail when no success from last retry?