# multi hosts in block/rescue

**URL:** <https://forum.ansible.com/t/multi-hosts-in-block-rescue/34191>\
**Category:** Ansible Developer\
**Created:** [November 12, 2020, 7:38pm UTC](https://forum.ansible.com/t/multi-hosts-in-block-rescue/34191 "2020-11-12T19:38:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ken\_partridge](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@ken\_partridge](https://forum.ansible.com/u/ken_partridge)\
**Post date:** [November 12, 2020, 7:38pm UTC](https://forum.ansible.com/t/multi-hosts-in-block-rescue/34191/1 "2020-11-12T19:38:10Z")

</div>

Hello,  
We are writing a simple block/rescue playbook, where we see if a box is online and if its not we want to notify another box to this fact.  
I apologize in advance but it look like another hosts parameters can not be defined in the rescue block, is there a way and i am a little dense?  
Thanks

- name: Get Device Status  
hosts: pi\_server  
gather\_facts: False

tasks:

- name: Wait for system to become reachable  
block:
- name: Wait wait\_on\_connection  
wait\_for\_connection:  
timeout: 10
- name: Gather facts for first time  
setup:  
rescue:
- name: there was a problem, lets notify another box  
hosts: another\_device  
another\_module\_to\_notify\_a\_device:  
msg: ‘I caught an error’

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [November 12, 2020, 7:47pm UTC](https://forum.ansible.com/t/multi-hosts-in-block-rescue/34191/2 "2020-11-12T19:47:56Z")

</div>

You want to use `delegate_to`

rescue:

- name: there was a problem, lets notify another box  
another\_module\_to\_notify\_a\_device:

msg: ‘I caught an error’  
delegate\_to: another\_device
