I am using Ansible to deploy my docker stack file using azure devOps pipeline. I am using group name defined in inventory file, which has more than one host.
Inventory file:
[my_web_server_group]
host1
host2
host2
My requirement is: before running deployment task in playbook, I need to find a host name from this group which is up & running. SO that i can deploy my stack on that specific host only.
Any one has idea how can i perform health check of hosts in that group and use that specific single healthy host for deployment.