It'd be worth checking if a command: task using curl works. If not it's probably a shell environment (proxy?) issue.
I've seen curl work where get_url: / uri: doesn't if you are hitting an SNI endpoint, my workaround is a command: task. Issue here: https://github.com/ansible/ansible-modules-core/issues/1716 On 28 February 2017 at 09:42, norricorp <[email protected]> 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 [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/f4133ed5-8800-4c8c-8304-de095a245c7c%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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/CAK5eLPRh6s4TEk8QM1X0c%3Dr5ax0jLXimmNtuN4rMu9Y-yZvfDQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
