Need help to reboot the host

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

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

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

Hello Magnus,

Thanks for the tip!

Best Regards,
Jayanth

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