I have an Ansible playbook that is used to automate the backup of a server and database (both on the same VM).
Last night during the middle of the playbook's run, rsync ran into a host unreachable error and the playbook failed. I was unaware that the "rescue" part of the blocks will not be executed in the case of a host unreachable. This caused the rescue to not be run and the service we were backing up did not come online, meaning that many people were unable to do work in the morning.
I'm looking for a way to catch the host unreachable error within something like a "failed_when" so that I can execute a task to start the service in the off chance that this happens again.
Does anyone have any ideas?