# Ansible winrm connectivity issue.

**URL:** <https://forum.ansible.com/t/ansible-winrm-connectivity-issue/24438>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [May 9, 2017, 8:13pm UTC](https://forum.ansible.com/t/ansible-winrm-connectivity-issue/24438 "2017-05-09T20:13:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramkrishnadevops25](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@ramkrishnadevops25](https://forum.ansible.com/u/ramkrishnadevops25)\
**Post date:** [May 9, 2017, 8:13pm UTC](https://forum.ansible.com/t/ansible-winrm-connectivity-issue/24438/1 "2017-05-09T20:13:31Z")

</div>

Hi ,

Need your help in fixing this issue.

I have a sample playbook that I have created to get ipconfig from windows machine using ansible playbook. I am trying to run the playbook from centos machine that is where I am getting below error. Your help is highly appreciated.

Hosts file:

[windows-instance]

172.28.48.57

[windows-instance:vars]

ansible\_ssh\_user=Administrator

ansible\_ssh\_pass=Gj=aWHl@Vqc9vJO4K(-Dd3C3xTC)aA-F

ansible\_ssh\_port=5986

ansible\_connection=winrm

ansible\_winrm\_cert\_validation=ignore

ansible\_winrm\_scheme=http

Playbook:

- name: test raw module

hosts: windows-instance

tasks:

- name: run ipconfig

raw: ipconfig

register: ipconfig

- debug: var=ipconfig

Error:-

ansible-playbook -i /etc/ansible/hosts windows\_playbook.yaml -vvv

No config file found; using defaults

PLAYBOOK: windows\_playbook.yaml \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\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\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

Using module file /usr/local/lib/python2.7/site-packages/ansible/modules/windows/setup.ps1

\<172.28.48.57\> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5985 TO 172.28.48.57

**fatal: [172.28.48.57]: UNREACHABLE! =\> {**

**“changed”: false,**

**“msg”: “plaintext: HTTPConnectionPool(host=‘172.28.48.57’, port=5985): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(\<requests.packages.urllib3.connection.HTTPConnection object at 0x7f2a2a2c8350\>, ‘Connection to 172.28.48.57 timed out. (connect timeout=30)’))”,**

**“unreachable”: true**

**}**

to retry, use: --limit @/home/rama.gopisetti/ansible/windows\_playbook.retry

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

172.28.48.57 : ok=0 changed=0 **unreachable=1** failed=0

---

<div class="post-metadata">

**Author:** ![groupfiles14](https://avatars.discourse-cdn.com/v4/letter/g/54ee81/32.png) [@groupfiles14](https://forum.ansible.com/u/groupfiles14)\
**Post date:** [May 10, 2017, 7:22am UTC](https://forum.ansible.com/t/ansible-winrm-connectivity-issue/24438/2 "2017-05-10T07:22:39Z")

</div>

it is using default port 5985, but you have mentioned 5986 in vars…check that

---

<div class="post-metadata">

**Author:** ![ramkrishnadevops25](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@ramkrishnadevops25](https://forum.ansible.com/u/ramkrishnadevops25)\
**Post date:** [May 12, 2017, 7:34pm UTC](https://forum.ansible.com/t/ansible-winrm-connectivity-issue/24438/3 "2017-05-12T19:34:21Z")

</div>

I changed it to 5985. still getting the same error. Your help is highly appreciated.

---

<div class="post-metadata">

**Author:** ![Trond\_Hindenes](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Trond\_Hindenes](https://forum.ansible.com/u/Trond_Hindenes)\
**Post date:** [May 16, 2017, 10:30pm UTC](https://forum.ansible.com/t/ansible-winrm-connectivity-issue/24438/4 "2017-05-16T22:30:49Z")

</div>

You shouldn’t have to use “ansible\_winrm\_scheme”. Could you comment out that and try again?
