Error ansible over powershell

Hello everyone!

I’m trying to use ansible over powershell but when I use this command:

“ansible chs -m win_ping”

Looks like that it’s using ssh because the error is:

x.x.x.x | UNREACHABLE! => {
“changed”: false,
“msg”: “SSH encountered an unknown error during the connection. We recommend you re-run the command using -vvvv, which will enable SSH debugging output to help diagnose the issue”,
“unreachable”: true
}

P.S. My host file (/root/ansible/hosts):
[chs]
x.x.x.x

Someone have any idea?

Hi,

Do you have
ansible_connection: winrm
set against your host or better still in the group vars that apply to your windows hosts. See http://docs.ansible.com/ansible/intro_windows.html#inventory

Ansible needs telling to use winrm, otherwise it will default to attempting ssh connection, which is not available on windows.

Jon