On 31. aug. 2016 16:10, [email protected] wrote:
I have a setup with Apache Mesos and Marathon.
I also deploy a Elasticsearch with JSON to the Mesos Cluster via Ansible.
But this should only be done, when a certain endpont
http://mesos...:8080/v2/apps/elasticserach
is NOT reachable. That indicates, that the module is already (or isn't)
installed.

How can I do that in my main.yml?

The principle is like this.

Use the uri[1] module to check the url and register[2] the output in a variable.

Use when[3] to check the variable to determine if the task should run or not.


[1] https://docs.ansible.com/ansible/uri_module.html
[2] https://docs.ansible.com/ansible/playbooks_variables.html#registered-variables
[3] https://docs.ansible.com/ansible/playbooks_conditionals.html

--
Kai Stian Olstad

--
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/e4e7641e-a5f6-99eb-622e-268de67cce50%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to