ansible and active directory

202 views
Skip to first unread message

jerome jarr

unread,
Aug 15, 2015, 9:46:48 AM8/15/15
to Ansible Project
Can someone explain me how to use an active directory user to connect to the machines with ansible please ?

i joined all my computers on the AD, on my ansible machine i have this:

> cat /etc/ansible/group_vars/windows-domain.yml

#it is suggested that these be encrypted with ansible-vault:
ansible_ssh_user: jer...@MONDOM.COM                  #jerome is in the ad admin group
ansible_ssh_pass: password
ansible_ssh_port: 5986
ansible_connection: winrm


> cat /etc/ansible/hosts

[windows-domain]
w7.MONDOM.COM

But when i do this i get this error :

ANSIBLE_LOAD_CALLBACK_PLUGINS=1 ansible windows-domain -m win_ping -vvvv

<w7.MONDOM.COM> ESTABLISH WINRM CONNECTION FOR USER:  on PORT 5986 TO w7.MONDOM.COM
<w7.MONDOM.COM> WINRM CONNECT: transport=plaintext endpoint=https://w7.MONDOM.COM:5986/wsman
<w7.MONDOM.COM> WINRM CONNECTION ERROR: 401 Unauthorized.
w7.MONDOM.COM | FAILED => 401 Unauthorized.

(it works fine if i use the local admin user)



Trond Hindenes

unread,
Aug 16, 2015, 4:48:24 AM8/16/15
to Ansible Project
Jerome, I just wrote about this a feew weeks back. See if this walkthru helps you:

Reply all
Reply to author
Forward
0 new messages