# Need help to reboot the host

**URL:** <https://forum.ansible.com/t/need-help-to-reboot-the-host/36333>\
**Category:** Ansible Developer\
**Created:** [February 15, 2022, 6:13am UTC](https://forum.ansible.com/t/need-help-to-reboot-the-host/36333 "2022-02-15T06:13:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayanth\_reddy](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jayanth\_reddy](https://forum.ansible.com/u/jayanth_reddy)\
**Post date:** [February 15, 2022, 6:13am UTC](https://forum.ansible.com/t/need-help-to-reboot-the-host/36333/1 "2022-02-15T06:13:39Z")

</div>

Hi Team,

I have multiple servers in one region and seperated with zone a &b

I need to reboot one system in zone a and once it come back i need to reboot rest of the systeme in zone a.  
Can you help with condition to write a ansible play for this.  
Thanks in advance

Best regards,  
Jayanth

---

<div class="post-metadata">

**Author:** ![Magnus\_Lubeck](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/magnus_lubeck/32/3905_2.png) [@Magnus\_Lubeck](https://forum.ansible.com/u/Magnus_Lubeck)\
**Post date:** [February 15, 2022, 7:49am UTC](https://forum.ansible.com/t/need-help-to-reboot-the-host/36333/2 "2022-02-15T07:49:49Z")

</div>

You can simply do it by having multiple plays in one playbook. Many ways to skin this cat.

```auto
---
- name: reboot server 1
hosts: server1
tasks:
- reboot
- name: reboot the rest
hosts: zoneA, !server1
tasks:
- reboot

```

---

<div class="post-metadata">

**Author:** ![jayanth\_reddy](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jayanth\_reddy](https://forum.ansible.com/u/jayanth_reddy)\
**Post date:** [February 15, 2022, 3:17pm UTC](https://forum.ansible.com/t/need-help-to-reboot-the-host/36333/3 "2022-02-15T15:17:40Z")

</div>

Hello Magnus,

Thanks for the tip!

Best Regards,  
Jayanth

---

<div class="post-metadata">

**Author:** ![jayanth\_reddy](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jayanth\_reddy](https://forum.ansible.com/u/jayanth_reddy)\
**Post date:** [February 22, 2022, 2:26am UTC](https://forum.ansible.com/t/need-help-to-reboot-the-host/36333/4 "2022-02-22T02:26:33Z")

</div>

Hello Magnus,

We need to use dynamic hosts with when condition. Here we are calling the hosts with tag names. Could please me in this condition.

Best regards,  
Jayanth
