# Connection Ansible with Windows host problem

**URL:** <https://forum.ansible.com/t/connection-ansible-with-windows-host-problem/30374>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [May 20, 2019, 9:40am UTC](https://forum.ansible.com/t/connection-ansible-with-windows-host-problem/30374 "2019-05-20T09:40:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryad9200000](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Post date:** [May 20, 2019, 9:40am UTC](https://forum.ansible.com/t/connection-ansible-with-windows-host-problem/30374/1 "2019-05-20T09:40:14Z")

</div>

Hey,

I want connect Ansible with my host Windows but i don’t understand why it’s not works.

I have groupe in **/etc/ansible/hosts :**

**[windows]**  
**101.5.213.11 ansible\_connection=ssh ansible\_shell\_type=powershell**

I have one **playbook.yml :**

**- name: “Installation de script SQL”**  
**hosts: “windows”**  
**gather\_facts: no**  
**roles:**  
**- role: “roles”**

**tasks:**

**- name: “Executer le script powershell”**  
**script: “files/script1.ps1”**

But same the simple ping it’s not works why ?

I look the documentation Ansible for windows but it not works 😕

Thanks for your help !! 🙂

Regards,

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [May 20, 2019, 9:54am UTC](https://forum.ansible.com/t/connection-ansible-with-windows-host-problem/30374/2 "2019-05-20T09:54:49Z")

</div>

> Hey,
> 
> I want connect Ansible with my host Windows but i don't understand why it's not works.
> 
> I have groupe in \*/etc/ansible/hosts :\*  
> \*  
> \*  
> \*[windows]\*  
> \*101.5.213.11 ansible\_connection=ssh ansible\_shell\_type=powershell\*
> 
> I have one \*playbook.yml :\*
> 
> \*- name: "Installation de script SQL"\*  
> \* hosts: "windows"\*  
> \* gather\_facts: no\*  
> \* roles:\*  
> \* - role: "roles"\*  
> \*  
> \*  
> \* tasks:\*  
> \*  
> \*  
> \* - name: "Executer le script powershell"\*  
> \* script: "files/script1.ps1"\*
> 
> But same the simple ping it's not works why ?

Hard to tell without seeing the output of the playbook run (add verbosity with -vv).

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![Igor\_Turovsky](https://avatars.discourse-cdn.com/v4/letter/i/cdc98d/32.png) [@Igor\_Turovsky](https://forum.ansible.com/u/Igor_Turovsky)\
**Post date:** [May 20, 2019, 10:07am UTC](https://forum.ansible.com/t/connection-ansible-with-windows-host-problem/30374/3 "2019-05-20T10:07:17Z")

</div>

Do you really connect to your Windows hosts via SSH? While it is possible with latest Windows, more common options are winrm/psrp connection plugins.

Thank you,

- Igor

---

<div class="post-metadata">

**Author:** ![ryad9200000](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@ryad9200000](https://forum.ansible.com/u/ryad9200000)\
**Post date:** [May 20, 2019, 1:16pm UTC](https://forum.ansible.com/t/connection-ansible-with-windows-host-problem/30374/4 "2019-05-20T13:16:45Z")

</div>

Hey,

Ok, i will try this option winrc/psrp connection plugings 🙂

Thanks very much !! 😉

Regards,
