Could it be that the host blocks outgoing HTTP traffic, and that you
have some proxy environment variable set in your interactive terminal
to reach HTTP content?

If that is the case, you should make Ansible aware of that:
http://docs.ansible.com/ansible/playbooks_environment.html

Dick

On 28 February 2017 at 10:42, norricorp <j...@norricorp.f9.co.uk> wrote:
> Hi,
> is the uri module a curl substitute?
> I ask because if, on the command line, I run curl, I get the expected json
> output from a tomcat rest application. In the logs is a 200 result.
> But if I run the same in uri then ...
>     - name: test with curl type command
>       uri:
>          url: http://centos7-ansible:8080/heroes/heroes
>
> TASK [test with curl type command]
> *********************************************
> fatal: [localhost]: FAILED! => {"changed": false, "content": "", "failed":
> true, "msg": "Status code was not [200]: Connection failure: timed out",
> "redirected": false, "status": -1, "url":
> "http://centos7-ansible:8080/heroes/heroes"}
>
> What am I doing wrong?
>
> Regards,
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/f4133ed5-8800-4c8c-8304-de095a245c7c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Dick Visser
Sr. System & Network Engineer
GÉANT

Want to join us? We're hiring: https://www.geant.org/jobs

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwMtGvYySu28VtofQnoZbKk07xzsw9HMMrom7HVjBfXx9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to