# ignore\_unreachable statement does not work with block/rescue?

**URL:** <https://forum.ansible.com/t/ignore-unreachable-statement-does-not-work-with-block-rescue/33588>\
**Category:** Ansible Project\
**Created:** [August 11, 2020, 3:38pm UTC](https://forum.ansible.com/t/ignore-unreachable-statement-does-not-work-with-block-rescue/33588 "2020-08-11T15:38:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Gebirgslok](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@Peter\_Gebirgslok](https://forum.ansible.com/u/Peter_Gebirgslok)\
**Post date:** [August 11, 2020, 3:38pm UTC](https://forum.ansible.com/t/ignore-unreachable-statement-does-not-work-with-block-rescue/33588/1 "2020-08-11T15:38:32Z")

</div>

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:

---

<div class="post-metadata">

**Author:** ![Hrvoje\_Gaspar](https://avatars.discourse-cdn.com/v4/letter/h/3ab097/32.png) [@Hrvoje\_Gaspar](https://forum.ansible.com/u/Hrvoje_Gaspar)\
**Post date:** [August 12, 2020, 6:46am UTC](https://forum.ansible.com/t/ignore-unreachable-statement-does-not-work-with-block-rescue/33588/2 "2020-08-12T06:46:56Z")

</div>

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](https://docs.ansible.com/ansible/latest/modules/wait_for_connection_module.html)

---

<div class="post-metadata">

**Author:** ![Peter\_Gebirgslok](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@Peter\_Gebirgslok](https://forum.ansible.com/u/Peter_Gebirgslok)\
**Post date:** [August 12, 2020, 11:01am UTC](https://forum.ansible.com/t/ignore-unreachable-statement-does-not-work-with-block-rescue/33588/3 "2020-08-12T11:01:27Z")

</div>

Thank you, that works.

I appreciate the help .
