Answer the question
In order to leave comments, you need to log in
How to use domain accounts in ansible?
For example, I want to ping a Windows server.
There is a hosts file:
[servers]
tmagent24 ansible_host=10.22.41.220
[servers:vars]
ansible_user=ansible
[email protected]
ansible_connection=winrm
ansible_port=5986
ansible_winrm_server_cert_validation=ignore
---
- name: Test connection
hosts: servers
tasks:
- name: Ping
win_ping:
ansible-playbook playbook.yml
tmagent24 | UNREACHABLE! => {
"changed": false,
"msg": "ssl: the specified credentials were rejected by the server",
"unreachable": true
}
Answer the question
In order to leave comments, you need to log in
Naryl about kerberos, like what you need.
Added: ansible_winrm_transport= kerberos
Changed port: ansible_port=5985
Downloaded from repository, corrected krb2.conf config:
[realms]
CORP.LOC = {
kdc = dc.CORP.LOC
kdc = dc.CORP.LOC
default_domain = CORP.LOC
}
[domain_realm]
.corp.loc = CORP.LOC
corp.loc = CORP.LOC
TASK [Gathering Facts] **********************************************************************************************************************************************************************************************************************
fatal: [tmagent24]: 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}
PLAY RECAP **********************************************************************************************************************************************************************************************************************************
tmagent24 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question