# Error with win\_ping playbook

**URL:** <https://forum.ansible.com/t/error-with-win-ping-playbook/28656>\
**Category:** Ansible Project\
**Created:** [September 26, 2018, 12:09pm UTC](https://forum.ansible.com/t/error-with-win-ping-playbook/28656 "2018-09-26T12:09:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yann](https://avatars.discourse-cdn.com/v4/letter/y/bc79bd/32.png) [@Yann](https://forum.ansible.com/u/Yann)\
**Post date:** [September 26, 2018, 12:09pm UTC](https://forum.ansible.com/t/error-with-win-ping-playbook/28656/1 "2018-09-26T12:09:07Z")

</div>

Hi,

```auto
I meet the next pb when I run the module win_ping with playbook.

EXEC (via pipeline wrapper)
The full traceback is:
Au caract?re Ligne:4 : 3^M
+ & "^@^@^@C^@^@^@:^@^@^@\^@^@^@U^@^@^@s^@^@^@e^@^@^@r^@^@^@s^@^@^@\^@^@^@F^@^@^@C^@^@^@A^@^@^@P^@^@^@G^@^@^@2^@^@^@4^@^@^@\^@^@^@A^@^@^@p^@ ...^M
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I do not have this problem when I run it from the command line.

EXEC (via pipeline wrapper)
xxxxxxxxxxx | SUCCESS => {
    "changed": false,
    "ping": "pong"
}
META: ran handlers
META: ran handlers

For information, I use :
ansible_port: 5986
ansible_connection: winrm
ansible_winrm_transport: kerberos
ansible_winrm_server_cert_validation: ignore

Can you help me please ?

```

---

<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:** [September 26, 2018, 12:16pm UTC](https://forum.ansible.com/t/error-with-win-ping-playbook/28656/2 "2018-09-26T12:16:16Z")

</div>

Sounds like a playbook encoding issue.

---

<div class="post-metadata">

**Author:** ![Yann](https://avatars.discourse-cdn.com/v4/letter/y/bc79bd/32.png) [@Yann](https://forum.ansible.com/u/Yann)\
**Post date:** [September 26, 2018, 12:18pm UTC](https://forum.ansible.com/t/error-with-win-ping-playbook/28656/3 "2018-09-26T12:18:56Z")

</div>

- hosts: “{{ app }}.{{ envt }}.winping”  
gather\_facts: no  
tasks:
- name: Test win\_ping  
win\_ping:

---

<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:** [September 26, 2018, 7:11pm UTC](https://forum.ansible.com/t/error-with-win-ping-playbook/28656/4 "2018-09-26T19:11:13Z")

</div>

Sorry that’s my fault, the error is actually from the exec side and not a yaml parsing issue. Are you able to share the following;

\* The full output when running with -vvv for both runs  
\* Run “ansible-config dump --only-changed"  
\* Are there any environment variables you have that relates to Ansible?

Thanks

Jordan

---

<div class="post-metadata">

**Author:** ![Yann](https://avatars.discourse-cdn.com/v4/letter/y/bc79bd/32.png) [@Yann](https://forum.ansible.com/u/Yann)\
**Post date:** [September 27, 2018, 8:57am UTC](https://forum.ansible.com/t/error-with-win-ping-playbook/28656/5 "2018-09-27T08:57:45Z")

</div>

# ansible -m win\_ping windows -vvv

/usr/lib64/python2.6/site-packages/cryptography-2.3.1-py2.6-linux-x86\_64.egg/cryptography/hazmat/primitives/constant\_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare\_digest as soon as possible.  
utils.DeprecatedIn23,  
ansible 2.4.2.0  
config file = /etc/ansible/ansible.cfg  
configured module search path = [u’/home/ldap/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/lib/python2.6/site-packages/ansible  
executable location = /usr/bin/ansible  
python version = 2.6.6 (r266:84292, Aug 9 2016, 06:11:56) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]  
Using /etc/ansible/ansible.cfg as config file  
Parsed /etc/ansible/hosts inventory source with ini plugin  
META: ran handlers  
Using module file /usr/lib/python2.6/site-packages/ansible/modules/windows/win\_ping.ps1  
 ESTABLISH WINRM CONNECTION FOR USER: None on PORT 5986 TO xxxxxxxx  
/usr/lib/python2.6/site-packages/pywinrm-0.3.0-py2.6.egg/winrm/transport.py:299: UserWarning: Function does not contain optional arg send\_cbt, check installed version with pip list  
EXEC (via pipeline wrapper)  
xxxxxxxx | SUCCESS =\> {  
“changed”: false,  
“ping”: “pong”  
}  
META: ran handlers  
META: ran handlers

---

<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:** [September 27, 2018, 11:24am UTC](https://forum.ansible.com/t/error-with-win-ping-playbook/28656/6 "2018-09-27T11:24:01Z")

</div>

Fantastic that let’s me know what the issue is, you are coming across this [https://github.com/ansible/ansible/pull/45942](https://github.com/ansible/ansible/pull/45942). Effectively running Python 2.6 with ANSIBLE\_KEEP\_REMOTE\_FILES is causing the issue. While the pull request I linked you solves the issue, you shouldn’t be running ANSIBLE\_KEEP\_REMOTE\_FILES at all. This mode is only meant to be used for debugging purposes and effectively means all the temp files and modules are not deleted once run which is bad and a lot slower than the default pipeling process.

I would guess you have an ansible.cfg that is being picked up when running your playbook that has ‘keep\_remote\_files’ set [https://docs.ansible.com/ansible/latest/reference\_appendices/config.html#default-keep-remote-files](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-keep-remote-files). Remove this from the config and you should be go.

Thanks

Jordan

---

<div class="post-metadata">

**Author:** ![Yann](https://avatars.discourse-cdn.com/v4/letter/y/bc79bd/32.png) [@Yann](https://forum.ansible.com/u/Yann)\
**Post date:** [September 27, 2018, 1:06pm UTC](https://forum.ansible.com/t/error-with-win-ping-playbook/28656/7 "2018-09-27T13:06:02Z")

</div>

Perfect, removing the environment variable has solved the problem.

Thanks a lot for your help.

Yann
