# win\_ping issue

**URL:** <https://forum.ansible.com/t/win-ping-issue/16321>\
**Category:** Ansible Project\
**Tags:** windows, fedora\
**Created:** [September 24, 2014, 2:51pm UTC](https://forum.ansible.com/t/win-ping-issue/16321 "2014-09-24T14:51:27Z")\
**Posts on this page:** 12\
**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:** [September 24, 2014, 2:51pm UTC](https://forum.ansible.com/t/win-ping-issue/16321/1 "2014-09-24T14:51:27Z")

</div>

I’m having trouble getting win\_ping to work. Here is my info:  
Fedora 20  
Ansible 1.7.1  
Remote node running windows 7  
The WinRM script by Trond runs without errors on the remote node  
Control and Remote Machines are both on Lan with common domain w/o firewalls  
So far as I can tell I’ve installed everything on control and remote machine as described in documentation

My inventory file contains  
[ads800s]  
ADS-6999 ansible\_ssh\_host=123.123.123.123

My windows.yml file is in the group\_vars directory and contains  
ansible\_ssh\_user: ansmgr  
ansible\_ssh\_pass: ansiblepw  
ansible\_ssh\_port: 5986  
ansible\_connection: winrm

Can you tell what I’m doing wrong? Do you need any more information?

Here is the debugging output of my win\_ping command (with -c winrm is below)

[ansmgr@LinuxControlMachine ansible]$ ansible ADS-6999 -m win\_ping -vvvv  
\<123.123.123.123\> ESTABLISH CONNECTION FOR USER: ansmgr  
\<123.123.123.123\> REMOTE\_MODULE win\_ping  
\<123.123.123.123\> EXEC [‘ssh’, ‘-C’, ‘-tt’, ‘-vvv’, ‘-o’, ‘ControlMaster=auto’, ‘-o’, ‘ControlPersist=60s’, ‘-o’, ‘ControlPath=/home/ansmgr/.ansible/cp/ansible-ssh-%h-%p-%r’, ‘-o’, ‘Port=22’, ‘-o’, ‘KbdInteractiveAuthentication=no’, ‘-o’, ‘PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey’, ‘-o’, ‘PasswordAuthentication=no’, ‘-o’, ‘ConnectTimeout=10’, ‘123.123.123.123’, “/bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1411567957.01-192759344617423 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1411567957.01-192759344617423 && echo $HOME/.ansible/tmp/ansible-tmp-1411567957.01-192759344617423’”]  
ADS-6999 | FAILED =\> SSH encountered an unknown error. The output was:  
OpenSSH\_6.4, OpenSSL 1.0.1e-fips 11 Feb 2013  
debug1: Reading configuration data /etc/ssh/ssh\_config  
debug1: /etc/ssh/ssh\_config line 51: Applying options for \*  
debug1: auto-mux: Trying existing master  
debug1: Control socket “/home/ansmgr/.ansible/cp/ansible-ssh-123.123.123.123-22-ansmgr” does not exist  
debug2: ssh\_connect: needpriv 0  
debug1: Connecting to 123.123.123.123 [123.123.123.123] port 22.  
debug2: fd 3 setting O\_NONBLOCK  
debug1: connect to address 123.123.123.123 port 22: Connection refused  
ssh: connect to host 123.123.123.123 port 22: Connection refused

Here is the debugging output of my win\_ping command with -c winrm is below

[ansmgr@LinuxControlMachine ansible]$ ansible ADS-6999 -c winrm -m win\_ping -vvvv  
\<123.123.123.123\> ESTABLISH WINRM CONNECTION FOR USER: ansmgr on PORT 5986 TO 123.123.123.123  
ADS-6999 | FAILED =\> Traceback (most recent call last):  
File “/usr/lib/python2.7/site-packages/ansible/runner/ **init**.py”, line 561, in \_executor  
exec\_rc = self.\_executor\_internal(host, new\_stdin)  
File “/usr/lib/python2.7/site-packages/ansible/runner/ **init**.py”, line 666, in \_executor\_internal  
return self.\_executor\_internal\_inner(host, self.module\_name, self.module\_args, inject, port, complex\_args=complex\_args)  
File “/usr/lib/python2.7/site-packages/ansible/runner/ **init**.py”, line 837, in \_executor\_internal\_inner  
conn = self.connector.connect(actual\_host, actual\_port, actual\_user, actual\_pass, actual\_transport, actual\_private\_key\_file)  
File “/usr/lib/python2.7/site-packages/ansible/runner/connection.py”, line 34, in connect  
self.active = conn.connect()  
File “/usr/lib/python2.7/site-packages/ansible/runner/connection\_plugins/winrm.py”, line 132, in connect  
self.protocol = self.\_winrm\_connect()  
File “/usr/lib/python2.7/site-packages/ansible/runner/connection\_plugins/winrm.py”, line 71, in \_winrm\_connect  
cache\_key = ‘%s:%s@%s:%d’ % (self.user, hashlib.md5(self.password).hexdigest(), self.host, port)  
TypeError: md5() argument 1 must be string or buffer, not None

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [September 24, 2014, 3:32pm UTC](https://forum.ansible.com/t/win-ping-issue/16321/2 "2014-09-24T15:32:50Z")

</div>

It seems as though your group\_vars is not being picked up. Is your inventory file and your group\_vars directory located in the same place?

By default this is where ansible looks, so both should be in the same directory.

---

<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:** [September 24, 2014, 4:02pm UTC](https://forum.ansible.com/t/win-ping-issue/16321/3 "2014-09-24T16:02:49Z")

</div>

Both the inventory file (hosts) and the group\_vars folder are in /etc/ansible

---

<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:** [September 29, 2014, 10:36am UTC](https://forum.ansible.com/t/win-ping-issue/16321/4 "2014-09-29T10:36:19Z")

</div>

Try not setting the ansible\_ssh\_host in your inventory - I think this might be forcing it to attempt ssh transport, which of course isn’t going to work for windows hosts.

In other words, change

[ads800s]  
ADS-6999 ansible\_ssh\_host=123.123.123.123

to

ads800s]  
ADS-6999

and ensure ADS-6999 can either be resolved by your local dns or as an entry in /etc/hosts

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [September 29, 2014, 12:03pm UTC](https://forum.ansible.com/t/win-ping-issue/16321/5 "2014-09-29T12:03:04Z")

</div>

ansible\_ssh\_host does not imply the transport.

Let’s ask the starter question, “what’s the output of ansible --version” ?

---

<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:** [September 29, 2014, 1:12pm UTC](https://forum.ansible.com/t/win-ping-issue/16321/6 "2014-09-29T13:12:27Z")

</div>

ansible 1.7.1 (this and other details are in the original posting)

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [September 29, 2014, 1:20pm UTC](https://forum.ansible.com/t/win-ping-issue/16321/7 "2014-09-29T13:20:19Z")

</div>

Sorry for the confusion, I was replying to the incorrect assertion above and missed the scrollback.

Please make sure you file a ticket for this one as tracebacks in Ansible are definitely bugs, though it sounds like you need to either use --ask-pass or set ansible\_ssh\_pass – though the variable name is named “ssh” it’s not limited to being used just for SSH.

---

<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:** [September 29, 2014, 3:21pm UTC](https://forum.ansible.com/t/win-ping-issue/16321/8 "2014-09-29T15:21:52Z")

</div>

My windows.yml file is in the group\_vars directory and contains

---

<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:** [September 30, 2014, 5:27pm UTC](https://forum.ansible.com/t/win-ping-issue/16321/9 "2014-09-30T17:27:28Z")

</div>

>

---

<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:28pm UTC](https://forum.ansible.com/t/win-ping-issue/16321/10 "2014-11-07T15:28:57Z")

</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”}’

---

<div class="post-metadata">

**Author:** ![Bluesky1](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@Bluesky1](https://forum.ansible.com/u/Bluesky1)\
**Post date:** [July 13, 2017, 2:42am UTC](https://forum.ansible.com/t/win-ping-issue/16321/11 "2017-07-13T02:42:34Z")

</div>

hello，Skinnedknuckles

I ask you how the final solution to the problem? I also encountered this Error, hope you can get your help, thank you very much!

在 2014年9月24日星期三 UTC+8下午10:51:28，skinnedknuckles写道：

---

<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:** [July 14, 2017, 2:05am UTC](https://forum.ansible.com/t/win-ping-issue/16321/12 "2017-07-14T02:05:48Z")

</div>

check out this post for detailed items to check on your setup

[https://groups.google.com/forum/#!topic/ansible-project/DJqUWVnH5Go](https://groups.google.com/forum/#!topic/ansible-project/DJqUWVnH5Go)
