Is there a way in Ansible to check a particular condition (e.g., the health status of Elasticsearch cluster) in a loop?

25 views
Skip to first unread message

Qian Zhang

unread,
Jan 1, 2017, 9:59:01 PM1/1/17
to Ansible Project
Hi,

I am going to use Ansible to deploy Elasticsearch and Logstash. Before deploying Logstash, I'd like to check if the health status of Elasticsearch cluster is green or not, e.g.,

epoch             timestamp     cluster                        status 
1482992016   06:13:36       elasticsearch-default  green

It will take some time for Elasticsearch cluster to become healthy, so I'd like to check it in a loop until it become healthy or timeout. Is it possible to do this with Ansible? Thanks!



Regards,
Qian

Trond Hindenes

unread,
Jan 2, 2017, 8:27:27 AM1/2/17
to Ansible Project
You're probably after the "Do until" example found in the docs: http://docs.ansible.com/ansible/playbooks_loops.html
Reply all
Reply to author
Forward
0 new messages