You can do something like this (thanks to Matt Martz who originally 
suggested it)

- name: check if app is up and ready to serve the wsdl
  uri:
    url: 'http://{{ inventory_hostname }}/app/app.wsdl'
    return_content: yes
    timeout: 2
  delegate_to: localhost
  register: poll_result
  until: poll_result['status']|default(0) == 200
  retries: 40
  delay: 3

This tries the url every 3 seconds for a maximum of 40 attempts.

Hope this helps,

Jon

On Friday, October 27, 2017 at 11:55:37 AM UTC+1, abhay gupta wrote:
>
> Hello Friends,
>
> I need your help to finish my task.
>
> In my playbook, we are starting a web server which took almost 4-7 minutes.
> I need to write a task, in which we need to hit a wsdl in after 1 minute 
> and if we are getting the 200 response message as a response. need to print 
> a message" Web server is up and running". 
> And if after some time, let's say till 10 minutes if the wsdl is not 
> getting the 200 response message, it should say, "Web server is not 
> correctly deployed."
>
> Thanks.
> Abhay.
>
>

-- 
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/70895851-bdb5-4a1f-88d8-c25afeb62adb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to