# Ansible Not Passing Domain

**URL:** <https://forum.ansible.com/t/ansible-not-passing-domain/20748>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [March 2, 2016, 2:44pm UTC](https://forum.ansible.com/t/ansible-not-passing-domain/20748 "2016-03-02T14:44:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![navarone52](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@navarone52](https://forum.ansible.com/u/navarone52)\
**Post date:** [March 2, 2016, 2:44pm UTC](https://forum.ansible.com/t/ansible-not-passing-domain/20748/1 "2016-03-02T14:44:11Z")

</div>

I’m trying to get Ansible working with Windows Systems. I’m currently testing it against 2k8 box.

Run: ansible windows -m win\_ping -vvvvv (I have one system in the windows group)

Returns:

\<[System.DOMAIN.COM](http://System.DOMAIN.COM)\> ESTABLISH WINRM CONNECTION FOR USER: ansible\_user on PORT 5986 TO [System.DOMAIN.COM](http://System.DOMAIN.COM)  
\<[System.DOMAIN.COM](http://System.DOMAIN.COM)\> WINRM CONNECT: transport=plaintext endpoint=[https://System.DOMAIN.COM:5986/wsman](https://System.DOMAIN.COM:5986/wsman)  
\<[System.DOMAIN.COM](http://System.DOMAIN.COM)\> WINRM CONNECTION ERROR: 401 Unauthorized. basic auth failed  
[System.DOMAIN.COM](http://System.DOMAIN.COM) | FAILED =\> 401 Unauthorized. basic auth failed

My windows.yml looks like this

ansible\_ssh\_user: [ansible\_user@DOMAIN.COM](mailto:ansible_user@DOMAIN.COM)  
ansible\_ssh\_pass: PASSWORD

ansible\_ssh\_port: 5986  
ansible\_connection: winrm

So the error seems pretty straight forward and the event viewer on the system shows the same issue as you can see below. Looking at the below log when the failure happens the Account Domain is showing up as the local system name. It appears the domain portion over the username is not being sent to the windows system. Can anyone provide assistance to what I may be doing wrong here?

An account failed to log on.

Subject:  
Security ID: NETWORK SERVICE  
Account Name: System$  
Account Domain: Domain  
Logon ID: 0x3e4

Logon Type: 3

Account For Which Logon Failed:  
Security ID: NULL SID  
Account Name: ansible\_user  
Account Domain: System

Failure Information:  
Failure Reason: Unknown user name or bad password.  
Status: 0xc000006d  
Sub Status: 0xc0000064

Process Information:  
Caller Process ID: 0x4e8  
Caller Process Name: C:\Windows\System32\svchost.exe

Network Information:  
Workstation Name: System  
Source Network Address: -  
Source Port: -

Detailed Authentication Information:  
Logon Process: Advapi  
Authentication Package: Negotiate  
Transited Services: -  
Package Name (NTLM only): -  
Key Length: 0

Also krb is setup and kinit [ansible\_user@DOMAIN.COM](mailto:ansible_user@DOMAIN.COM) does work correctly.

---

<div class="post-metadata">

**Author:** ![navarone52](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@navarone52](https://forum.ansible.com/u/navarone52)\
**Post date:** [March 2, 2016, 2:46pm UTC](https://forum.ansible.com/t/ansible-not-passing-domain/20748/2 "2016-03-02T14:46:56Z")

</div>

Also it’s ansible 1.9.4

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [March 2, 2016, 3:34pm UTC](https://forum.ansible.com/t/ansible-not-passing-domain/20748/3 "2016-03-02T15:34:40Z")

</div>

My guess would be that you don’t have the python kerberos library installed as it looks like ansible is making a plaintext connection rather than a kerberos one.

from the command line on your ansible controller, start python and enter

import kerberos

if you don’t have kerberos you will get a python traceback, if you do you don’t get an error.

Hope this helps,

Jon

---

<div class="post-metadata">

**Author:** ![navarone52](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@navarone52](https://forum.ansible.com/u/navarone52)\
**Post date:** [March 2, 2016, 4:17pm UTC](https://forum.ansible.com/t/ansible-not-passing-domain/20748/4 "2016-03-02T16:17:11Z")

</div>

I do have python-kerberos installed.

---

<div class="post-metadata">

**Author:** ![Jeff4](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@Jeff4](https://forum.ansible.com/u/Jeff4)\
**Post date:** [July 26, 2016, 10:27pm UTC](https://forum.ansible.com/t/ansible-not-passing-domain/20748/5 "2016-07-26T22:27:19Z")

</div>

Did you find a solution to this issue?
