Hi,

I have somewhat of an edge-case I just have no idea how to properly handle 
using Ansible.

In a playbook, I'm provisioning an AWS Elasticsearch domain, an 
asynchronous task. On AWS, booting the cluster takes a few minutes, so 
meanwhile I'm free to provision other stuff (EC2, RDS, etc.) At some point 
though, I must know what the URL (endpoint) of the Elasticsearch cluster 
is, so that I can register it and move forward with the playbook. Getting 
this info is easy, just an aws-cli command away: aws es 
describe-elasticsearch-domain--domain-name my-es-domain.

Now, by the time the command is issued, the cluster might not be ready. The 
JSON response will tell me, if the DomainStatus.Endpoint key is missing 
then the cluster is not up and running and I should wait until it becomes 
available.

So essentially, I'm trying to find the best way to emulate a "wait_for" 
behavior but for a JSON payload. Checking the JSON response and retrying 
the command on a regular basis until the expected key is available. Any 
insights?

Thank you!

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8ff4f63c-da9e-4e4f-8098-16bb0b60b9ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to