Ansible module win_uri

286 views
Skip to first unread message

Jeremy Hobbs

unread,
Apr 7, 2020, 6:08:59 PM4/7/20
to Ansible Project
I currently have a playbook that use the uri module to connect to an API and get a json request. This was working properly.   I am now attempting to implement NTLM or Kerberos  authentication on the web server.   I attempted to change it to the win_uri module and add the username and password to the parameters. When I run it, I get an error for powershell.  

fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "/bin/sh: powershell: command not found\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 127}


After searching some, the only thing I found, was someone saying that you have to delegate the task to a windows machine and setup a listener on the windows machine. 

Has anyone used the win_uri module?  Is that correct. that you have you delegate the task to a windows machine.  That seems like a lot of unnecessary work.There is plenty of python modules that will pass windows authentication.  

Has anyone found a better solution or got any ideas? 


thanks
Jeremy
 

Matt Martz

unread,
Apr 7, 2020, 7:11:02 PM4/7/20
to ansible...@googlegroups.com
The win_uri module is written in PowerShell and designed to be run on a Windows target.

--
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-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/900d3807-deec-48a6-b7f2-0ecc1032069a%40googlegroups.com.
--
Matt Martz
@sivel
sivel.net

Jeremy Hobbs

unread,
Apr 7, 2020, 8:27:36 PM4/7/20
to Ansible Project
is there another module that would work for a basic json request that includes options for authentication? 

thanks
Jeremy


On Tuesday, April 7, 2020 at 6:11:02 PM UTC-5, Matt Martz wrote:
The win_uri module is written in PowerShell and designed to be run on a Windows target.
On Tue, Apr 7, 2020 at 5:09 PM Jeremy Hobbs <gly...@gmail.com> wrote:
I currently have a playbook that use the uri module to connect to an API and get a json request. This was working properly.   I am now attempting to implement NTLM or Kerberos  authentication on the web server.   I attempted to change it to the win_uri module and add the username and password to the parameters. When I run it, I get an error for powershell.  

fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "/bin/sh: powershell: command not found\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 127}


After searching some, the only thing I found, was someone saying that you have to delegate the task to a windows machine and setup a listener on the windows machine. 

Has anyone used the win_uri module?  Is that correct. that you have you delegate the task to a windows machine.  That seems like a lot of unnecessary work.There is plenty of python modules that will pass windows authentication.  

Has anyone found a better solution or got any ideas? 


thanks
Jeremy
 

--
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...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages