Unable to git clone on Windows host via win_shell/win_command

Hi All,
I’m hitting a wall wrt to win_shell and a “git clone”. I am trying to use win_shell to clone a git repo w/o success. I am getting the below error.

`
Using module file /home/user/.local/lib/python2.7/site-packages/ansible/modules/windows/win_shell.ps1
Pipelining is enabled.
<<HOST_NAME>> ESTABLISH PSRP CONNECTION FOR USER: ON PORT 5985 TO <HOST_NAME>
<<HOST_NAME>> PSRP OPEN RUNSPACE: auth=negotiate configuration=Microsoft.PowerShell endpoint=http://<HOST_NAME>:5985/wsman
PSRP: EXEC (via pipeline wrapper)
<<HOST_NAME>> PSRP RC: 0
<<HOST_NAME>> PSRP STDOUT: {“start”:“2019-11-04 11:56:37.380685”,“stdout”:“”,“cmd”:“git clone https://example.com/scm/project/tools.git",“msg”:"non-zero return code”,“stderr”:“Cloning into \u0027tools\u0027…\nLogon failed, use ctrl+c to cancel basic credential prompt.\r\nbash: /dev/tty: No such device or address\nerror: failed to execute prompt script (exit code 1)\nfatal: could not read Username for \u0027https://example.com\u0027: tools error”,“changed”:true,“rc”:1,“failed”:true,“delta”:“0:00:01.984372”,“end”:“2019-11-04 11:56:39.365057”}
<<HOST_NAME>> PSRP STDERR:
<<HOST_NAME>> PSRP CLOSE RUNSPACE: 26C4A0F7-D74B-4E23-9CBA-02C47DAD8A8E
fatal: [<HOST_NAME>]: FAILED! => {
“changed”: true,
“cmd”: “git clone https://example.com/scm/project/tools.git”,
“delta”: “0:00:01.984372”,
“end”: “2019-11-04 11:56:39.365057”,
“msg”: “non-zero return code”,
“rc”: 1,
“start”: “2019-11-04 11:56:37.380685”,
“stderr”: “Cloning into ‘tools’…\nLogon failed, use ctrl+c to cancel basic credential prompt.\r\nbash: /dev/tty: No such device or address\nerror: failed to execute prompt script (exit code 1)\nfatal: could not read Username for ‘https://example.com’: No tools”,
“stderr_lines”: [
“Cloning into ‘tools’…”,
“Logon failed, use ctrl+c to cancel basic credential prompt.”,
“bash: /dev/tty: No such device or address”,
“error: failed to execute prompt script (exit code 1)”,
“fatal: could not read Username for ‘https://example.com’: No tools”
],
“stdout”: “”,
“stdout_lines”:
}

`

My yml file looks like this:
`

By default a network login on Windows does not have the users password available so it cannot take advantage of things that are encrypted with their credentials. This includes things like the Windows credential manager so it’s unable to find the password for your remote URL. You either need to connect with credssp auth or use become on the task with the users explicit credentials to bypass this.

Thanks

Jordan

Hi Jordan. Thanks for the information.

I tried CredSSP (and kerberos) and both give me a:

`
fatal: [<HOST_NAME>]: FAILED! => {
“changed”: false,
“module_stderr”: “#< CLIXML\r\n”,
“module_stdout”: “”,
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,
“rc”: 1
}

`

I’ve enabled CredSSP on the agent via:

Enable-WSManCredSSP -Role Server -Force

and I am able to ping with credssp enabled:
`
$ ansible all -i hosts -m win_ping
<HOST_NAME> | SUCCESS => {
“changed”: false,
“ping”: “pong”
}

`

Ben

I’m using Enable-WSManCredSSP -Role Server -Force
I’m able to use win_ping but git clone via Shell still got hang up… Any help is appreciated!