I am trying to connect to a windows host using win_ping module. Also enabled Basic and Allowencrypted True on windows hosts as well. But still I am getting the error "“ssl: the specified credentials were rejected by the server” , trying with the local user which is under Adminitsrator Group. And we are able to login to the windows host successfully with the same username and password whatever I am giving in the group_vars/windows.yml.
ansible windows -m win_ping
testvm | UNREACHABLE! => {
“changed”: false,
“msg”: “ssl: the specified credentials were rejected by the server”,
“unreachable”: true
}
It’s best to move to an Agent-Based configuration management Tool Such as SaltStack for Windows if your Machines are been managed by GPO which is preventing Ansible to Connect.
Or else configure everything before the machine joins the Domain
You WinRM service has been set to reject Basic auth. You need to change the auth to something like kerberos (for domain auth) or ntlm using the ansible_winrm_transport var.
Just change the username and password to that domain account. Typically the user is either in the Netlogon ‘DOMAIN\user’ form or the UPN ‘user@DOMAIN.COM’ form. The latter is preferred as it’s what is required for Kerberos auth which should be used for domain logons.