# win\_ping not getting executed

**URL:** <https://forum.ansible.com/t/win-ping-not-getting-executed/15964>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [August 15, 2014, 10:25pm UTC](https://forum.ansible.com/t/win-ping-not-getting-executed/15964 "2014-08-15T22:25:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vinit\_Khandagle](https://avatars.discourse-cdn.com/v4/letter/v/9de053/32.png) [@Vinit\_Khandagle](https://forum.ansible.com/u/Vinit_Khandagle)\
**Post date:** [August 15, 2014, 10:25pm UTC](https://forum.ansible.com/t/win-ping-not-getting-executed/15964/1 "2014-08-15T22:25:05Z")

</div>

Hello ,

I am trying to use win\_ping module to connect to a windows server. but it keeps defaulting to SSH

→ ansible --version  
ansible 1.7.1  
linbynd@linbynd-Inspiron:~/packer\_prac  
 → ansible -i hosts win -m win\_ping -u Administrator -vvv  
\<192.168.1.4\> ESTABLISH CONNECTION FOR USER: Administrator  
\<192.168.1.4\> REMOTE\_MODULE win\_ping  
\<192.168.1.4\> EXEC [‘ssh’, ‘-C’, ‘-tt’, ‘-q’, ‘-o’, ‘ControlMaster=auto’, ‘-o’, ‘ControlPersist=1800s’, ‘-o’, ‘ControlPath=/home/linbynd/.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’, ‘User=Administrator’, ‘-o’, ‘ConnectTimeout=10’, ‘192.168.1.4’, “/bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1408141292.45-166274142953398 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1408141292.45-166274142953398 && echo $HOME/.ansible/tmp/ansible-tmp-1408141292.45-166274142953398’”]  
^CTraceback (most recent call last):

Any idea what could be the issue, I am trying to use for windows.

- Vinit

---

<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:** [August 15, 2014, 11:27pm UTC](https://forum.ansible.com/t/win-ping-not-getting-executed/15964/2 "2014-08-15T23:27:37Z")

</div>

Have you set ansible\_connection=winrm in your inventory file?

[http://docs.ansible.com/intro\_windows.html#inventory](http://docs.ansible.com/intro_windows.html#inventory)

There are several inventory vars required to identify the host as windows.

Alternatively you can specify “-c winrm” on the command line for this too.

---

<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:** [August 16, 2014, 3:07pm UTC](https://forum.ansible.com/t/win-ping-not-getting-executed/15964/3 "2014-08-16T15:07:44Z")

</div>

Looks like you might have Control-C’d the system but not pasted the full traceback.

Can you please paste the full output or was that it?

The traceback is the most valuable part for us.

Thanks!

---

<div class="post-metadata">

**Author:** ![Vinit\_Khandagle](https://avatars.discourse-cdn.com/v4/letter/v/9de053/32.png) [@Vinit\_Khandagle](https://forum.ansible.com/u/Vinit_Khandagle)\
**Post date:** [August 16, 2014, 8:22pm UTC](https://forum.ansible.com/t/win-ping-not-getting-executed/15964/4 "2014-08-16T20:22:18Z")

</div>

sure let me try setting the winrm variable, I have not done that… If I am facing the issue even with that I will just paste the traceback as well. @Michael, I did a crtl-c. But let me paste the whole out put too.

Thanks

- Vinit
