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
* 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

On 29 August 2017 at 15:41, Seeram Venkatesh
<[email protected]> wrote:
> Hi Raj,
> Thanks for the response.
> Ya I figured out something about uri module and wrote a started writing a
> play.
> ---
> - name: hitting admin console
>   hosts: appservers
>   become: true
>   become_user: weblogic
>   tasks:
>    - name: post to consul
>      uri:
>      url: http://graycsm1wv/CherwellAPI/
>
> I got the following error.
> TASK [post to consul]
> ***************************************************************************************************************************************
> fatal: [10.11.60.92]: FAILED! => {"failed": true, "msg": "Failed lookup url
> for http://graycsm1wv/CherwellAPI/ : <urlopen error [Errno 111] Connection
> refused>"}
>
> Please suggest here.
> Also is there any example how to pass credentials for that url to login?
>
> TIA.
>
> On Tue, Aug 29, 2017 at 9:35 AM, raj kr <[email protected]> wrote:
>>
>> 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
>>
>> On Tuesday, August 29, 2017 at 6:55:11 PM UTC+5:30, Seeram Venkatesh
>> wrote:
>>>
>>> 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.
>>>
>>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Ansible Project" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/ansible-project/hdpP689dM6Y/unsubscribe.
>> To unsubscribe from this group and all its topics, 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/f2e09727-2e09-44ae-9a6f-41e8c3794319%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/CAKQb6PFFp0duUr4Zv48jLVv9s8mUG7fY4s1hvw-znpLtAnhCBw%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 
Dick Visser
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 [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/CAL8fbwNDnDiAgd58nBzqCVQY2nKDprFe3Qc3Ka_CLBVmv%3Dh6OA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to