Hey Guys,
I need some assistance on the below error. I’ve tried everything but I’m not able to resolve the same.
TASK [Join to Domain] **************************************************************************************************************
task path: /etc/ansible/playbooks/DeployVM/Server2019_Vsphere.yml:46
ESTABLISH LOCAL CONNECTION FOR USER: administrator
EXEC /bin/sh -c ‘echo ~administrator && sleep 0’
EXEC /bin/sh -c ‘( umask 77 && mkdir -p “echo /home/administrator/.ansible/tmp
”&& mkdir “echo /home/administrator/.ansible/tmp/ansible-tmp-1634251564.5118623-32501-66747911642149
” && echo ansible-tmp-1634251564.5118623-32501-66747911642149=“echo /home/administrator/.ansible/tmp/ansible-tmp-1634251564.5118623-32501-66747911642149
” ) && sleep 0’
Using module file /home/administrator/.ansible/collections/ansible_collections/ansible/windows/plugins/modules/win_domain_membership.ps1
PUT /home/administrator/.ansible/tmp/ansible-local-324573ec1oxrx/tmp_rkwbrs9 TO /home/administrator/.ansible/tmp/ansible-tmp-1634251564.5118623-32501-66747911642149/AnsiballZ_win_domain_membership.ps1
EXEC /bin/sh -c ‘chmod u+x /home/administrator/.ansible/tmp/ansible-tmp-1634251564.5118623-32501-66747911642149/ /home/administrator/.ansible/tmp/ansible-tmp-1634251564.5118623-32501-66747911642149/AnsiballZ_win_domain_membership.ps1 && sleep 0’
EXEC /bin/sh -c ‘powershell /home/administrator/.ansible/tmp/ansible-tmp-1634251564.5118623-32501-66747911642149/AnsiballZ_win_domain_membership.ps1 && sleep 0’
EXEC /bin/sh -c ‘rm -f -r /home/administrator/.ansible/tmp/ansible-tmp-1634251564.5118623-32501-66747911642149/ > /dev/null 2>&1 && sleep 0’
fatal: [localhost]: FAILED! => {
“changed”: false,
“module_stderr”: “\u001b[91mParserError: \u001b[0m/home/administrator/.ansible/tmp/ansible-tmp-1634251564.5118623-32501-66747911642149/AnsiballZ_win_domain_membership.ps1:151\n\u001b[96mLine |\n\u001b[96m 151 | \u001b[0m \u001b[96m\u0000\u001b[0m\u0000\u0000\u0000{"module_entry": "IyFwb3dlcnNoZWxsCgojIENvcHlyaWdodDogKGMpIDIwMTc …\n\u001b[96m | \u001b[91m ~\n\u001b[91m\u001b[96m | \u001b[91munexpected token ‘\u0000’, expected ‘begin’, ‘process’, ‘end’, or\n\u001b[96m | \u001b[91m’dynamicparam’.\n\u001b[0m\n”,
“module_stdout”: “”,
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,
“rc”: 1
}
PLAY RECAP *************************************************************************************************************************
localhost : ok=1 changed=1 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
So technically I’m trying to spin a VM in vSphere and connect that Vm to domain using Ansible and below is what my playbook looks like: