Why not use the uri module instead of fragile shell + curl ?

On Fri, 6 Mar 2020 at 13:47, Rakesh Parida <[email protected]>
wrote:

> Hi,
>
> I have a task as follows:
>
> - hosts: nodes
>   gather_facts: true
>   tasks:
>     - name: CurlCP Status
>       shell: "curl -Is -m 1 http://localhost:9113/cp/healthcheck";
>       register: cp_status
>       failed_when: "'200 OK' not in cp_status.stdout_lines"
>
> It fails even if 200 Ok is in o/p. I want to fail the job only when 200 OK
> is not in o/p
> Pls help here
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/6589d432-2ae7-4fcb-a7ba-926cfb3f2a17%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/6589d432-2ae7-4fcb-a7ba-926cfb3f2a17%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwPg1U9ZKz3YiDf%3Dra1ArqOYgnhFym7HxzXW2h2pYRYU0g%40mail.gmail.com.

Reply via email to