# Ansible over SSH on Windows host type progress status needed

**URL:** <https://forum.ansible.com/t/ansible-over-ssh-on-windows-host-type-progress-status-needed/30074>\
**Category:** Ansible Developer\
**Tags:** windows\
**Created:** [April 6, 2019, 4:45pm UTC](https://forum.ansible.com/t/ansible-over-ssh-on-windows-host-type-progress-status-needed/30074 "2019-04-06T16:45:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefano\_Leandro](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@Stefano\_Leandro](https://forum.ansible.com/u/Stefano_Leandro)\
**Post date:** [April 6, 2019, 4:45pm UTC](https://forum.ansible.com/t/ansible-over-ssh-on-windows-host-type-progress-status-needed/30074/1 "2019-04-06T16:45:19Z")

</div>

Hi Folks,

I’m quite new with Ansible.  
I’m projecting a new one automation platform with that in a mixed large enterprise enviroment.  
Sadly i found that Ansible not still supporting Windows OS over SSH.  
so, I’m asking how 's going with this feature ?

I cannot use WinRM in very large enterprise enviroment due to some lacks of security requirements…

Someone have some status ?

Thank you ,

Stefano Leandro

---

<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 6, 2019, 8:11pm UTC](https://forum.ansible.com/t/ansible-over-ssh-on-windows-host-type-progress-status-needed/30074/2 "2019-04-06T20:11:16Z")

</div>

Not sure what you mean by WinRMs lack of security requirements, if you use RDP in your org then WinRM is no worse than that. In saying that, SSH support for Windows has been added for 2.8 with [https://github.com/ansible/ansible/pull/47732](https://github.com/ansible/ansible/pull/47732). It’s experimental and the interface can change in the future but it would be enough to get you started.

---

<div class="post-metadata">

**Author:** ![Stefano\_Leandro](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@Stefano\_Leandro](https://forum.ansible.com/u/Stefano_Leandro)\
**Post date:** [May 20, 2019, 9:05pm UTC](https://forum.ansible.com/t/ansible-over-ssh-on-windows-host-type-progress-status-needed/30074/3 "2019-05-20T21:05:09Z")

</div>

Hi team,

I’m just tryining ansible 2.8 over ssh on windows hosts type but it seems not yet work:  
[WARNING]: No python interpreters found for host 192.168.1.146 (tried [‘/usr/bin/python’, ‘python3.7’, ‘python3.6’, ‘python3.5’,  
‘python2.7’, ‘python2.6’, ‘/usr/libexec/platform-python’, ‘/usr/bin/python3’, ‘python’])

192.168.1.146 | FAILED! =\> {  
“ansible\_facts”: {  
“discovered\_interpreter\_python”: “/usr/bin/python”  
},  
“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 again."\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 valid. It must result in a command \r\nname, a script block, or a CommandInfo object.\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  
}

This is the statement :  
ansible winservers -i win\_inventory -m ping

This is my inventory win\_inventory:  
#ansible\_connection=ssh

# Set either cmd or powershell not both

#ansible\_shell\_type=cmd  
#ansible\_shell\_type=powershell

[winservers]  
192.168.1.146  
[winservers:vars]  
ansible\_ssh\_user=administrator  
ansible\_ssh\_private\_key\_file=/opt/REPO-KEYS/sleandro-key-repo/KEY/sleandro.pub  
ansible\_shell\_type=cmd  
ansible\_connection=ssh

I installed the sshd for windows via chocolatey

The version of sshd is OpenSSH\_for\_Windows\_7.9p1, LibreSSL 2.6.5

What’s wrong? or i 'm missing something ?

Thank you ,

Stefano

---

<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:** [May 21, 2019, 1:02am UTC](https://forum.ansible.com/t/ansible-over-ssh-on-windows-host-type-progress-status-needed/30074/4 "2019-05-21T01:02:57Z")

</div>

These question are better suited towards the Ansible Project mailing list at [https://groups.google.com/forum/#!forum/ansible-project](https://groups.google.com/forum/#!forum/ansible-project). Ansible Development is for development questions inside Ansible, such as modules, plugins and so on and not general help.

Using ssh does not mean you can start using Python modules like ping, you still need to use the Windows equivalent modules which are written in PowerShell (win\_ping).

---

<div class="post-metadata">

**Author:** ![Stefano\_Leandro](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@Stefano\_Leandro](https://forum.ansible.com/u/Stefano_Leandro)\
**Post date:** [May 21, 2019, 1:14am UTC](https://forum.ansible.com/t/ansible-over-ssh-on-windows-host-type-progress-status-needed/30074/5 "2019-05-21T01:14:22Z")

</div>

Hi ,  
thank you for your time .

It was my fault .  
It works :

[root@ORKy ansible]# ansible winservers -i win\_invetory -m win\_ping  
192.168.1.146 | SUCCESS =\> {  
“changed”: false,  
“ping”: “pong”  
}  
[root@ORKy ansible]#

Cheers ,

Stefano
