something like this should work

- name: "wait for status"
  shell: bash -c 'curl -s http://{{  server_name }}:
*8093/service/actuator/health* |egrep "^status"'
  register: cmd_res
  retries: "60"
  delay: 1
  until: cmd_res.stdout.find('"status": "UP") != -1

On Friday, January 25, 2019 at 5:25:16 AM UTC-8, John Simmons wrote:
>
> Hi Hope you can help me again
>
> I need to wait for a spring application to start before moving on in my 
> playbook.
> when the microservice starts it runs flyway script that can take a long 
> time to run before the service actually starts working.
>
> would the uri module be able to check a specific url for specific text?
>
> so if i wanted to check: *localhost:8093/service/actuator/health*
>
> for this text:
>
>   "status" : "UP"
>
> and not just look for a 200 message?
>
> is this possible? if so how
>
> Many thanks in advance
>
> John
>

-- 
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/18727b34-a135-40f5-b3d8-9f8cadeffb6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to