windows ansible powershell in 2.3.1

Hello Folks

I am seeing issues when try to run powershell script from ansible after upgrade from 2.2.1 to 2.3.1, any ideas, suggestions are appreciated?

[root@marx4150 playbooks]# ansible-playbook -i inventory AdIntRhel.yml --tags crtObj --extra-vars “vm_name=testing123”

PLAY [win] ***************************************************************************************************************************************

TASK [script] ************************************************************************************************************************************
fatal: [mawx0001.abc.corp]: UNREACHABLE! => {“changed”: false, “msg”: “Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in "/tmp". Failed command was: PowerShell -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -EncodedCommand UwBlAHQALQBTAHQAcgBpAGMAdABNAG8AZABlACAALQBWAGUAcgBzAGkAbwBuACAATABhAHQAZQBzAHQACgAoAE4AZQB3AC0ASQB0AGUAbQAgAC0AVAB5AHAAZQAgAEQAaQByAGUAYwB0AG8AcgB5ACAALQBQAGEAdABoACAAJABlAG4AdgA6AHQAZQBtAHAAIAAtAE4AYQBtAGUAIAAiAGEAbgBzAGkAYgBsAGUALQB0AG0AcAAtADEANQAwADYANwAyADQAMgA2ADEALgA2ADgALQAxADUANQA5ADcANgAxADgANgAxADgANwAyADYAMwAiACkALgBGAHUAbABsAE4AYQBtAGUAIAB8ACAAVwByAGkAdABlAC0ASABvAHMAdAAgAC0AUwBlAHAAYQByAGEAdABvAHIAIAAnACcAOwAKAEkAZgAgACgALQBuAG8AdAAgACQAPwApACAAewAgAEkAZgAgACgARwBlAHQALQBWAGEAcgBpAGEAYgBsAGUAIABMAEEAUwBUAEUAWABJAFQAQwBPAEQARQAgAC0ARQByAHIAbwByAEEAYwB0AGkAbwBuACAAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQApACAAewAgAGUAeABpAHQAIAAkAEwAQQBTAFQARQBYAEkAVABDAE8ARABFACAAfQAgAEUAbABzAGUAIAB7ACAAZQB4AGkAdAAgADEAIAB9ACAAfQA=, exited with result 1”, “unreachable”: true}
to retry, use: --limit @/home/athangal/playbooks/AdIntRhel.retry

PLAY RECAP ***************************************************************************************************************************************

mawx0001.abc.corp : ok=0 changed=0 unreachable=1 failed=0

[root@marx4150 playbooks]# ansible mawx0001.abc.corp -m win_ping
mawx0001.abc.corp | SUCCESS => {
“changed”: false,
“ping”: “pong”
}

[root@marx4150 playbooks]# cat AdIntRhel.yml

Is the windows host running server 2008? If so I think there is an open bug report about running the script module against that version of Windows.

However it might be possible to solve the problem in a different way. Ansible 2.3 includes win_domain_membership modulehttp://docs.ansible.com/ansible/latest/win_domain_membership_module.html which I think may be does what you need.

Hope this helps,

Jon

It is Windows Server 2008 R2 standard. Is this bug fixed in it 2.4?
I am using the script for creating the object in Activer Directory OU only for both windows and linux machine, not sure if this module work for linux machine as the joining the domain process is differnt from windows. in any case I will give it a try, but I need to use domain ou path which is supported in 2.4 :slight_smile:
Thanks Jon for the help.