# Using Ansible with remote nodes running Windows 7

**URL:** <https://forum.ansible.com/t/using-ansible-with-remote-nodes-running-windows-7/16601>\
**Category:** Ansible Project\
**Tags:** windows, fedora\
**Created:** [October 24, 2014, 6:05pm UTC](https://forum.ansible.com/t/using-ansible-with-remote-nodes-running-windows-7/16601 "2014-10-24T18:05:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan\_Anderson](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@Jonathan\_Anderson](https://forum.ansible.com/u/Jonathan_Anderson)\
**Post date:** [October 24, 2014, 6:05pm UTC](https://forum.ansible.com/t/using-ansible-with-remote-nodes-running-windows-7/16601/1 "2014-10-24T18:05:32Z")

</div>

Has anyone succeeded at running ansible with a remote node running Windows 7? I’m having problems getting win-ping to work in this configuration. I’ve tried Fedora 20 and CentOs7 with Ansible 1.8. My inventory and windows.yml files are good and I’ve run

pip install [http://github.com/diyan/pywinrm/archive/master.zip#egg=pywinrm](http://github.com/diyan/pywinrm/archive/master.zip#egg=pywinrm)

Here is my debug output.

[ansmgr@localhost ansible]$ ansible windows -c winrm -m win\_ping --ask-pass -vvvv  
SSH password:  
\<123.123.123.123\> ESTABLISH WINRM CONNECTION FOR USER: ansmgr on PORT 5986 TO 123.123.123.123  
\<123.123.123.123\> WINRM CONNECT: transport=plaintext endpoint=[https://123.123.123.123:5986/wsman](https://123.123.123.123:5986/wsman)  
\<123.123.123.123\> WINRM CONNECTION ERROR: 500 WinRMTransport. [Errno 104] Connection reset by peer  
\<123.123.123.123\> WINRM CONNECT: transport=plaintext endpoint=[http://123.123.123.123:5986/wsman](http://123.123.123.123:5986/wsman)  
123.123.123.123 | FAILED =\> Traceback (most recent call last):

File “/etc/ansible/lib/ansible/runner/ **init**.py”, line 559, in \_executor  
exec\_rc = self.\_executor\_internal(host, new\_stdin)  
File “/etc/ansible/lib/ansible/runner/ **init**.py”, line 732, in \_executor\_internal  
return self.\_executor\_internal\_inner(host, self.module\_name, self.module\_args, inject, port, complex\_args=complex\_args)  
File “/etc/ansible/lib/ansible/runner/ **init**.py”, line 895, in \_executor\_internal\_inner  
conn = self.connector.connect(actual\_host, actual\_port, actual\_user, actual\_pass, actual\_transport, actual\_private\_key\_file)  
File “/etc/ansible/lib/ansible/runner/connection.py”, line 44, in connect  
self.active = conn.connect()  
File “/etc/ansible/lib/ansible/runner/connection\_plugins/winrm.py”, line 132, in connect  
self.protocol = self.\_winrm\_connect()  
File “/etc/ansible/lib/ansible/runner/connection\_plugins/winrm.py”, line 86, in \_winrm\_connect  
protocol.send\_message(‘’)  
File “/usr/lib/python2.7/site-packages/winrm/protocol.py”, line 173, in send\_message  
return self.transport.send\_message(message)  
File “/usr/lib/python2.7/site-packages/winrm/transport.py”, line 76, in send\_message  
response = urlopen(request, timeout=self.timeout)  
File “/usr/lib64/python2.7/urllib2.py”, line 127, in urlopen  
return \_opener.open(url, data, timeout)  
File “/usr/lib64/python2.7/urllib2.py”, line 404, in open  
response = self.\_open(req, data)  
File “/usr/lib64/python2.7/urllib2.py”, line 422, in \_open  
‘\_open’, req)  
File “/usr/lib64/python2.7/urllib2.py”, line 382, in \_call\_chain  
result = func(\*args)  
File “/usr/lib64/python2.7/urllib2.py”, line 1216, in http\_open  
return self.do\_open(httplib.HTTPConnection, req)  
File “/usr/lib64/python2.7/urllib2.py”, line 1189, in do\_open  
r = h.getresponse(buffering=True)  
File “/usr/lib64/python2.7/httplib.py”, line 1045, in getresponse  
response.begin()  
File “/usr/lib64/python2.7/httplib.py”, line 409, in begin  
version, status, reason = self.\_read\_status()  
File “/usr/lib64/python2.7/httplib.py”, line 365, in \_read\_status  
line = self.fp.readline(\_MAXLINE + 1)  
File “/usr/lib64/python2.7/socket.py”, line 476, in readline  
data = self.\_sock.recv(self.\_rbufsize)  
error: [Errno 104] Connection reset by peer

---

<div class="post-metadata">

**Author:** ![Chris\_Church1](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@Chris\_Church1](https://forum.ansible.com/u/Chris_Church1)\
**Post date:** [October 25, 2014, 7:28pm UTC](https://forum.ansible.com/t/using-ansible-with-remote-nodes-running-windows-7/16601/2 "2014-10-25T19:28:41Z")

</div>

It seems like there may be a firewall/config issue preventing you from connecting. Can you try the following using curl?

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [October 26, 2014, 10:56pm UTC](https://forum.ansible.com/t/using-ansible-with-remote-nodes-running-windows-7/16601/3 "2014-10-26T22:56:57Z")

</div>

I’ve had a couple of a occasions where I thought I had the firewall rules set right on my windows hosts but eventually realised they were set for the wrong profile - if you aren’t connecting as a domain user make sure the profile is ‘public’, for example.

---

<div class="post-metadata">

**Author:** ![Jonathan\_Anderson](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@Jonathan\_Anderson](https://forum.ansible.com/u/Jonathan_Anderson)\
**Post date:** [November 7, 2014, 3:27pm UTC](https://forum.ansible.com/t/using-ansible-with-remote-nodes-running-windows-7/16601/4 "2014-11-07T15:27:44Z")

</div>

There must be a problem with my encryption because when I run this line in powershell it works.

winrm set winrm/config/service ‘@{AllowUnencrypted=“true”}’
