Powershell script failing when run in playbook - works on other servers and runs ok manually on target host - cannot find path

7 views
Skip to first unread message

java_cat33

unread,
May 17, 2018, 8:05:15 PM5/17/18
to Ansible Project
The play copies a powershell script and runs it on the target - the script looks up files in C:\Temp. This path definitely exists.

I can run this play without issues against other test servers - now that I want to run this play on the actual server I want to configure I get the below error.....

fatal: [servername]: FAILED! => {"changed": true, "msg": "non-zero return code", "rc": 1, "stderr": "Get-ChildItem : Cannot find path 'C:\\Temp' because it does not exist.\r\nAt C:\\Users\...........

Running the same Powershell script locally on the target server returns a json file - no errors thrown.

WinRM config etc is all ok.

Let me know if you need more info...

Thanks!

java_cat33

unread,
May 17, 2018, 9:09:45 PM5/17/18
to Ansible Project
OK - issue resolved.... was targeting wrong server in inventory file!
Reply all
Reply to author
Forward
0 new messages