I am having problems authenticating with AD on Windows machines from my mobile site. I have a valid ticket in keberos -
klist Credentials cache: FILE:/tmp/krb5cc_1000 Principal: ansible@SOMEDOMAIN.LOCAL Issued Expires Principal Mar 10 09:15:27 2017 Mar 10 19:15:24 2017 krbtgt/ SOMEDOMAIN.LOCAL@SOMEDOMAIN.LOCAL
My kerberos configuration looks good to me -
cat /etc/krb5.conf [libdefaults] default_realm = SOMEDOMAIN.LOCAL
When I run the test command - ansible windows -m win_ping -vvvvv I get
'Server not found in Kerberos database'. ansible windows -m win_ping -vvvvv Using /etc/ansible/ansible.cfg as config file Loading callback plugin minimal of type stdout, v2.0 from /usr/lib/python2.7/dist-packages/ansible/plugins/callback/__init__.pyc Using module file /usr/lib/python2.7/dist-packages/ansible/modules/core/windows/win_ping.ps1 <kerberostest.somedomain.local> ESTABLISH WINRM CONNECTION FOR USER: ansible@SOMEDOMAIN.LOCAL on PORT 5986 TO kerberostest.somedomain.local <kerberostest.somedomain.local> WINRM CONNECT: transport=kerberos endpoint=https://kerberostest.somedomain.local:5986/wsman <kerberostest.somedomain.local> WINRM CONNECTION ERROR: authGSSClientStep() failed: (('Unspecified GSS failure. Minor code may provide more information', 851968), ('Server not found in Kerberos database', -1765328377)) Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/ansible/plugins/connection/winrm.py", line 154, in _winrm_connect self.shell_id = protocol.open_shell(codepage=65001) # UTF-8 File "/home/prosperity/.local/lib/python2.7/site-packages/winrm/protocol.py", line 132, in open_shell res = self.send_message(xmltodict.unparse(req)) File "/home/prosperity/.local/lib/python2.7/site-packages/winrm/protocol.py", line 207, in send_message return self.transport.send_message(message) File "/home/prosperity/.local/lib/python2.7/site-packages/winrm/transport.py", line 181, in send_message prepared_request = self.session.prepare_request(request) File "/home/prosperity/.local/lib/python2.7/site-packages/requests/sessions.py", line 407, in prepare_request hooks=merge_hooks(request.hooks, self.hooks), File "/home/prosperity/.local/lib/python2.7/site-packages/requests/models.py", line 306, in prepare self.prepare_auth(auth, url) File "/home/prosperity/.local/lib/python2.7/site-packages/requests/models.py", line 543, in prepare_auth r = auth(self) File "/home/prosperity/.local/lib/python2.7/site-packages/requests_kerberos/kerberos_.py", line 308, in __call__ auth_header = self.generate_request_header(None, host, is_preemptive=True) File "/home/prosperity/.local/lib/python2.7/site-packages/requests_kerberos/kerberos_.py", line 148, in generate_request_header raise KerberosExchangeError("%s failed: %s" % (kerb_stage, str(error.args))) KerberosExchangeError: authGSSClientStep() failed: (('Unspecified GSS failure. Minor code may provide more information', 851968), ('Server not found in Kerberos database', -1765328377)) kerberostest.somedomain.local | UNREACHABLE! => { "changed": false, "msg": "kerberos: authGSSClientStep() failed: (('Unspecified GSS failure. Minor code may provide more information', 851968), ('Server not found in Kerberos database', -1765328377))", "unreachable": true }
I can ssh to the target machine
ssh -v1 kerberostest.somedomain.local -p 5986 OpenSSH_7.3p1 Ubuntu-1, OpenSSL 1.0.2g 1 Mar 2016 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug1: Connecting to kerberostest.somedomain.local [10.10.20.84] port 5986. debug1: Connection established.
I can also ping all hosts with their hostname. I am at a loss: (
Here is the irreplaceable host file -
sudo cat /etc/ansible/hosts
I also tried connecting to the domain using realmd with success, but running the ansible command gave the same result.