# i Cant connect to windows server

**URL:** <https://forum.ansible.com/t/i-cant-connect-to-windows-server/23021>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [November 14, 2016, 4:10pm UTC](https://forum.ansible.com/t/i-cant-connect-to-windows-server/23021 "2016-11-14T16:10:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![challa.tek](https://avatars.discourse-cdn.com/v4/letter/c/b38774/32.png) [@challa.tek](https://forum.ansible.com/u/challa.tek)\
**Post date:** [November 14, 2016, 4:10pm UTC](https://forum.ansible.com/t/i-cant-connect-to-windows-server/23021/1 "2016-11-14T16:10:28Z")

</div>

> your server is still trying to ssh into the server.

host file should like this:

localhost ansible\_connection=local

[win]  
10.XXX.XXX.XXX

[win:vars]  
ansible\_connection=winrm  
ansible\_ssh\_port=5986  
ansible\_ssh\_user=  
ansible\_ssh\_pass=  
ansible\_winrm\_server\_cert\_validation=ignore

playbook should contain  
hosts: win

and when you try running playbook, try  
ansible-playbook XXX.yml -i hosts
