Hiya everyone!
Let me preface this by saying I’m traditionally a Linux admin, and am nearly clueless about everything Microsoft, including Active Directory, so please bare with me here.
The problem is I’m trying to execute ansible WinRM commands against one of our datacenters, lets call it dc1, from a central datacenter, lets call it dc0. dc0 contains our primary Domain Controller (PROD.COMPANY.COM). dc1 contains a secondary Domain Controller (DC1.PROD.COMPANY.COM). My understanding is that when logging into a machine in dc1, DC1.PROD.COMPANY.COM forwards the login request to PROD.COMPANY.COM, and everything’s dandy. I have Kerberos setup on my executor box (located in dc0), and I can successfully run kinit user@PROD.COMPANY.COM and get a kerberos ticket. klist shows everything I would expect. However, when I run a command against a machine in the dc1 datacenter, I get back an error message that says:
Cannot contact any KDC for realm ‘DC1.PROD.COMPANY.COM’
Do I need to have access to that secondary domain controller as well? All the auth is happening in dc0 against PROD.COMPANY.COM, so is that ticket not good enough? I am able to login to boxes in dc0, so that leads me to believe this is the case, but the IT guys are hesitant to open up that access unless I can confirm that, and even then they would really rather I proxy this request somehow (I see squid will let me do that, but I’d really rather not go through all that if I don’t have to. although we have an existing NGINX proxy, so if I can use that that would be a pretty big win).
Here’s my Kerberos setup:
[libdefaults]
default_realm = PROD.COMPANY.COM
[realms]
PROD.COMPANY.COM = {
kdc = prod.company.com
}
[domain_realm]
.prod.company.com = PROD.COMPANY.COM
prod.company.com = PROD.COMPANY.COM
And I’ve tried appending:
.dc1.prod.company.com = PROD.COMPANY.COM
to that “domain_realm” list, but to no avail.
The command I’m trying to run is:
ansible -i /opt/company/our-inventory-script osfamily_windows --limit datacenter_dc1 -m win_ping -vvv
And here’s the output:
hostname.dc1.prod.company.com | FAILED => {
“failed”: true,
“msg”: “Error! kerberos: ((‘Unspecified GSS failure. Minor code may provide more information.’, 851968), ("Cannot contact any KDC for realm ‘DC1.PROD.COMPANY.COM’", -1765328228)), ssh: 500 WinRMTransport. [Errono 111] Connection refused”
}
hostname.dc0.prod.company.com | SUCCESS => {
“changed”: false,
“ping”: “pong”
}
Any thoughts? I really feel like I’m running up against something silly, and I just don’t have the Kerberos/AD experience to catch it. Alternatively, does Ansible support NTLM at all? All my research says “not now, but maybe soon”, but that would get me up and going.
Thanks in advance!