ignore_unreachable statement does not work with block/rescue?

Hello guys,
I’m trying to check if the server is still reachable with a block -rescue statement.
If the server is no longer available, the rescue statement should do something.

This is basically the simple playbook:

wait_for_connection might be more suitable for reachability checks in your case:
https://docs.ansible.com/ansible/latest/modules/wait_for_connection_module.html

Thank you, that works.

I appreciate the help .