On 2014-09-17 11:06 pm, Brian Coca wrote:
well, in that case I would use wait_for to let the server come up and
then get_url inside a do-until loop to get the 'green light'.

I had that configuration initially after I realized wait_for would not do what I needed. Then I realized setting a timeout on the curl call (-m 2) gets me effectively the same thing. If the node isn't back up yet, the curl call times out and the grep fails. No need to run two tasks.

--[Lance]

- name: wait node {{ansible_hostname}}-{{service}}
local_action: "shell curl -s -m 2 'localhost:9200/_cat/nodes?h=name' | tr -d ' ' | grep -E '^{{ansible_hostname}}-{{service}}$' "
  register: result
  until: result.rc == 0
  retries: 200
  delay: 3
  notify:
  - cluster routing all {{ansible_hostname}}-{{service}}


--
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/61fb30271e73b730bd1e27ad9b570258%40webmail.bearcircle.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to