# Problem connecting to Windows Server 2008R2 host

**URL:** <https://forum.ansible.com/t/problem-connecting-to-windows-server-2008r2-host/32807>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [April 29, 2020, 5:04am UTC](https://forum.ansible.com/t/problem-connecting-to-windows-server-2008r2-host/32807 "2020-04-29T05:04:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_Lucas](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@Martin\_Lucas](https://forum.ansible.com/u/Martin_Lucas)\
**Post date:** [April 29, 2020, 5:04am UTC](https://forum.ansible.com/t/problem-connecting-to-windows-server-2008r2-host/32807/1 "2020-04-29T05:04:43Z")

</div>

I did some Googling and found ansible\_python\_interpreter which I set to C:\Program\ Files\Python3.7.5. This removed the python not found warning and the output is now:

ansible -m ping 192.168.230.3 -vvv  
ansible 2.8.3  
config file = /etc/ansible/ansible.cfg  
configured module search path = [‘/home/cyborg/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/lib/python3/dist-packages/ansible  
executable location = /usr/bin/ansible  
python version = 3.7.5 (default, Apr 19 2020, 20:18:17) [GCC 9.2.1 20191008]  
Using /etc/ansible/ansible.cfg as config file  
host\_list declined parsing /etc/ansible/hosts as it did not pass it’s verify\_file() method  
script declined parsing /etc/ansible/hosts as it did not pass it’s verify\_file() method  
auto declined parsing /etc/ansible/hosts as it did not pass it’s verify\_file() method  
Parsed /etc/ansible/hosts inventory source with ini plugin  
META: ran handlers  
Using module file /usr/lib/python3/dist-packages/ansible/modules/system/ping.py  
Pipelining is enabled.  
\<192.168.230.3\> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 192.168.230.3  
EXEC (via pipeline wrapper)  
192.168.230.3 | FAILED! =\> {  
“changed”: false,  
“module\_stderr”: "Exception calling "Create" with "1" argument(s): "At line:4 char:21\r\n+ def \_ansiballz\_main():\r\n+ ~\r\nAn expression was expected after ‘(’.\r\nAt line:13 char:27\r\n+ except (AttributeError, OSError):\r\n+ ~\r\nMissing argument in parameter list.\r\nAt line:15 char:7\r\n+ if scriptdir is not None:\r\n+ ~\r\nMissing ‘(’ after ‘if’ in if statement.\r\nAt line:22 char:7\r\n+ if sys.version\_info \< (3,):\r\n+ ~\r\nMissing ‘(’ after ‘if’ in if statement.\r\nAt line:22 char:30\r\n+ if sys.version\_info \< (3,):\r\n+ ~\r\nMissing expression after ‘,’.\r\nAt line:22 char:25\r\n+ if sys.version\_info \< (3,):\r\n+ ~\r\nThe ‘\<’ operator is reserved for future use.\r\nAt line:24 char:32\r\n+ MOD\_DESC = (‘.py’, ‘U’, imp.PY\_SOURCE)\r\n+ ~\r\nMissing expression after ‘,’.\r\nAt line:24 char:33\r\n+ MOD\_DESC = (‘.py’, ‘U’, imp.PY\_SOURCE)\r\n+ ~~~~~~~~~~~~~\r\nUnexpected token ‘imp.PY\_SOURCE’ in expression or statement.\r\nAt line:24 char:32\r\n+ MOD\_DESC = (‘.py’, ‘U’, imp.PY\_SOURCE)\r\n+ ~\r\nMissing closing ‘)’ in expression.\r\nAt line:24 char:46\r\n+ MOD\_DESC = (‘.py’, ‘U’, imp.PY\_SOURCE)\r\n+ ~\r\nUnexpected token ‘)’ in expression or statement.\r\nNot all parse errors were reported. Correct the reported errors and try \r\nagain."\r\nAt line:6 char:1\r\n+ $exec\_wrapper = [ScriptBlock]::Create($split\_parts[0])\r\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : NotSpecified: (🙂 , MethodInvocationException\r\n + FullyQualifiedErrorId : ParseException\r\n \r\nThe expression after ‘&’ in a pipeline element produced an object that was not \r\nvalid. It must result in a command name, a script block, or a CommandInfo \r\nobject.\r\nAt line:7 char:2\r\n+ &$exec\_wrapper\r\n+ ~~~~~~~~~~~~~ \r\n + CategoryInfo : InvalidOperation: (🙂 , RuntimeException\r\n + FullyQualifiedErrorId : BadExpression\r\n ",  
“module\_stdout”: “”,  
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,  
“rc”: 1  
}

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [April 29, 2020, 7:42am UTC](https://forum.ansible.com/t/problem-connecting-to-windows-server-2008r2-host/32807/2 "2020-04-29T07:42:18Z")

</div>

See [https://docs.ansible.com/ansible/latest/user\_guide/windows\_faq.html#what-windows-modules-are-available](https://docs.ansible.com/ansible/latest/user_guide/windows_faq.html#what-windows-modules-are-available), you cannot run Python modules on Windows. You need to use the win\_\* variants if they are available.
