# Ansible for Windows: strange behavior

**URL:** <https://forum.ansible.com/t/ansible-for-windows-strange-behavior/23994>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [March 17, 2017, 10:17am UTC](https://forum.ansible.com/t/ansible-for-windows-strange-behavior/23994 "2017-03-17T10:17:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michele\_Viviani](https://avatars.discourse-cdn.com/v4/letter/m/e5b9ba/32.png) [@Michele\_Viviani](https://forum.ansible.com/u/Michele_Viviani)\
**Post date:** [March 17, 2017, 10:17am UTC](https://forum.ansible.com/t/ansible-for-windows-strange-behavior/23994/1 "2017-03-17T10:17:19Z")

</div>

Hi,  
I do have some problems using Ansible with Windows.  
For many of my servers it works, but for some I’m receiving “HTTPConnectionPool(host=‘10.10.193.180’, port=5985): Read timed out” even if the WinRM configuration is correct. (it’s the same as several others)  
More over, if I run a Enter-PSSession [myhost.domain.com](http://myhost.domain.com) from another Windows server, it works and after that command also ansible win\_ping is responding.

Below my test case

---

<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:** [March 17, 2017, 12:45pm UTC](https://forum.ansible.com/t/ansible-for-windows-strange-behavior/23994/2 "2017-03-17T12:45:21Z")

</div>

Anything in the event log on the affected machines?

Do the affected machines run IIS? I recall a problem where the remoting didn’t work fully when some domain account mapping configuration was in place (unfortunately I don’t now remember the name of the domain user mapping mechanism, so can’t search for it).

Is there anything else different about the affected machines? Load? Network proximity?

Hope this helps,

Jon

---

<div class="post-metadata">

**Author:** ![Matt\_Davis](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@Matt\_Davis](https://forum.ansible.com/u/Matt_Davis)\
**Post date:** [March 17, 2017, 10:49pm UTC](https://forum.ansible.com/t/ansible-for-windows-strange-behavior/23994/3 "2017-03-17T22:49:06Z")

</div>

The only time I’ve ever seen that behavior is on the first request to a brand-new Windows AWS instance. For some reason, the shell creation can take up to 30s, much longer than our default operation timeout of ~5s.

You can try increasing the operation and read timeouts by adjusting the ansible\_winrm\_operation\_timeout\_sec and ansible\_winrm\_read\_timeout\_sec inventory vars (the read timeout must be \> than operation timeout). They’re set to relatively low values to minimize the “dead host” detection interval, and this doesn’t typically cause problems in normal operation.

-Matt

---

<div class="post-metadata">

**Author:** ![Michele\_Viviani](https://avatars.discourse-cdn.com/v4/letter/m/e5b9ba/32.png) [@Michele\_Viviani](https://forum.ansible.com/u/Michele_Viviani)\
**Post date:** [March 20, 2017, 1:45pm UTC](https://forum.ansible.com/t/ansible-for-windows-strange-behavior/23994/4 "2017-03-20T13:45:17Z")

</div>

Hi Matt,  
thanks for the suggestion. I’ve added

| 

ansible\_winrm\_operation\_timeout\_sec: 100 and

 |
| | |

ansible\_winrm\_read\_timeout\_sec: 120

to my settings and now it works!!

Mike
