The user isn't in the correct user@domain format firstly. Have you setup kerberos as per the Ansible documentation? It might also be an idea to check what version of pywinrm you're running. What version of Ansible is the server running?
No i not configure kerberos (other partner install ansible ansible 2.1.1.0 in our organization and tell us is not necesary install kerberos). pywinrm-0.2.1
Your group_vars file must be called ‘windows.yml’ not ‘Windows.yml’ otherwise the group name you have defined will not match (it is case-sensitive) and ansible will default to ssh connection.
name: Move file on remote Windows Server from one location to another
raw: CMD /C “MOVE /Y D:\origen\prueba.txt D:\destino\prueba.txt”
RESULT: . . . .
fatal: [server.domain.is]: UNREACHABLE! => {“changed”: false, “msg”: “Failed to connect to the host via ssh.”, “unreachable”: true}
if i change to
name: raw module example
hosts: windows
tasks:
name: Move file on remote Windows Server from one location to another
raw: CMD /C “MOVE /Y D:\origen\prueba.txt D:\destino\prueba.txt”
RESULT:succesfull but all skipped
Using /etc/ansible/ansible.cfg as config file
SSH password:
Loaded callback default of type stdout, v2.0
PLAYBOOK: pruebaaitorwin.yml ***************************************************
1 plays in pruebaaitorwin.yml
PLAY [raw module example] ******************************************************
skipping: no hosts matched
PLAY RECAP *********************************************************************
Ok it looks like your inventory and group vars aren’t matching up at the moment.
Please show your ansible-playbook command line.
Your ansible hosts file should be in in
/etc/ansible/hosts
and group vars in
/etc/ansible/group_vars/windows.yml
(You can use other locations but must use -i /path/to/ansible/hosts/file and the group_vars must be in sub directory under wherever your ansible inventory file is).
You can also configure in ansible.cfg so worth checking that ansible is configured in the default way.
Also you must use a local account name e.g. Administrator if you have not set up kerberos.
If you are using kerberos, please use username@realm (not username\realm or username/realm) otherwise kerberos will not be used.