0
votes

I've followed this guide to setup Ansible for use it with Windows Server.

But when I try to connect I obtain an error. The user used is Domain Administrator and has permissions to connect to that remote server.

$ klist

Ticket cache: KEYRING:persistent:1000:1000

Default principal: [email protected]

Valid starting Expires Service principal

07/29/2016 17:30:56 07/30/2016 03:30:56 krbtgt/[email protected] renew until 08/05/2016 17:30:50

$ ansible -m setup web -u [email protected]

trr-pp-wa1 | UNREACHABLE! => {

"changed": false,

"msg": "ssl: 401 Unauthorized.",

"unreachable": true

}

Can anyone help me?

Many thanks

1

1 Answers

0
votes

Two things:

Assuming you're using the latest pywinrm (0.2.0), did you install with the kerberos option (eg pip install pywinrm[kerberos])?

Also, if that doesn't cover it, try adding ansible_winrm_transport=kerberos to your inventory vars for that host. Newer versions are less forceful about assuming a particular authtype from the username (to allow for use of LiveID, etc).