Hello everyone,
For error handling I’m trying to use “block - rescue”. I looked im internet and found out that rescue doesn’t have any effekt if tasks in block failed because of unreachable host. Does anyone any workaround or idea how to manage it anyway?
Thank you very much!
Vlad
Hi Vlad,
Struggling with the same issue, did you get anywhere with it?
Thanks,
Graham
Hi Vlad,
Struggling with the same issue, did you get anywhere with it?
Thanks,
Graham
I suggest you delegate your rescue tasks to localhost - when things go wrong on remote hosts, the local host, where ansible is running, is the most likely thing to still be working. Documentation about delegation is here if you aren’t familiar with it: http://docs.ansible.com/ansible/latest/playbooks_delegation.html
You may need to adjust what you rescue actually does because of this - perhaps send a mail or message to get a human involved.
Hope this helps,
Jon