# Ansible playbook for accessing url

**URL:** <https://forum.ansible.com/t/ansible-playbook-for-accessing-url/25356>\
**Category:** Ansible Project\
**Created:** [August 29, 2017, 1:25pm UTC](https://forum.ansible.com/t/ansible-playbook-for-accessing-url/25356 "2017-08-29T13:25:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seeram\_Venkatesh](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@Seeram\_Venkatesh](https://forum.ansible.com/u/Seeram_Venkatesh)\
**Post date:** [August 29, 2017, 1:25pm UTC](https://forum.ansible.com/t/ansible-playbook-for-accessing-url/25356/1 "2017-08-29T13:25:11Z")

</div>

Hello Techies,

I am improvising my Ansible skills in a very slow pace and I got stuck here:  
Is there anyway to hit my ticket management system (cherwell) url and login to it with credentials through Ansible? I’ve so far researched about uri module but not able to fetch more?

TIA.

---

<div class="post-metadata">

**Author:** ![raj\_kr](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@raj\_kr](https://forum.ansible.com/u/raj_kr)\
**Post date:** [August 29, 2017, 1:35pm UTC](https://forum.ansible.com/t/ansible-playbook-for-accessing-url/25356/2 "2017-08-29T13:35:20Z")

</div>

This possible via uri,  
if rest api is supported on your managemennt system , you can define login structure and form url under uri and provide login structure to login

---

<div class="post-metadata">

**Author:** ![Seeram\_Venkatesh](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@Seeram\_Venkatesh](https://forum.ansible.com/u/Seeram_Venkatesh)\
**Post date:** [August 29, 2017, 1:41pm UTC](https://forum.ansible.com/t/ansible-playbook-for-accessing-url/25356/3 "2017-08-29T13:41:00Z")

</div>

Hi Raj,  
Thanks for the response.  
Ya I figured out something about uri module and wrote a started writing a play.

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [August 29, 2017, 5:53pm UTC](https://forum.ansible.com/t/ansible-playbook-for-accessing-url/25356/4 "2017-08-29T17:53:14Z")

</div>

Hi there

Couple of issues.  
\* Your indentation seems off - all the parameters for 'uri' need to be  
indented further. See  
[http://docs.ansible.com/ansible/latest/uri\_module.html#examples](http://docs.ansible.com/ansible/latest/uri_module.html#examples)  
\* By the looks of it you seem to want to do a POST request, but you  
didn't specify the method as such (and the default is GET). See  
previous URL.  
\* The error you're getting seems to indicate a name resolution issue.  
Remember that this code is not run on your management station, but on  
your target. So if that is not able to resolve "graycsm1wv" then it  
won't work. Given that it's a single label hostname you'll likely need  
some specific resolver local to your site.

Dick
