ping windows - ssl: the specified credentials were rejected by the serve

2,507 views
Skip to first unread message

norricorp

unread,
Jan 26, 2017, 4:09:49 AM1/26/17
to Ansible Project
Hi
I am running ansible 2.1.2.0 on centos7. The windows machine is running windows 10 with powershell 5.
I have installed pywinrm-0.2.2, included windows hostnames in the inventory file and also added group variables to this file for windows.
ansible_user=Administrator
ansible_password=password
ansible_port:=986
ansible_connection=winrm
ansible_winrm_server_cert_validation=ignore
I have also run the powershell script on the windows machine and received OK prompt.

I am doing this outside of a domain. If I ping the windows machine from centos outside of ansible I get replies. But with ansible I get

[root@centos7-ansible ~]# ansible mesh -m win_ping -v
Using /etc/ansible/ansible.cfg as config file
mesh | UNREACHABLE! => {
    "changed": false,
    "msg": "ssl: the specified credentials were rejected by the server",
    "unreachable": true
}

Any ideas what I am doing wrong?

Regards,
John

johnny.she...@gmail.com

unread,
Jan 26, 2017, 4:13:59 PM1/26/17
to Ansible Project
Hi,

Just a quick suggestion, but the ansible_port you've set is not the default. Have you changed it? If not, it should be 5986 not 986.

Johnny :)

John Norris

unread,
Jan 26, 2017, 4:24:43 PM1/26/17
to ansible...@googlegroups.com
Thanks for this Johnny.
That was typo in the message.  It was 
ansible_port:5986
and in my hosts file ([windows:vars] I have it as
      ansible_port=5986
but when I edited the copy and paste, I replaced :5 with = rather than just :.

So in summary, the port is right.




J Hawkesworth

unread,
Jan 27, 2017, 11:37:27 AM1/27/17
to Ansible Project, jo...@norricorp.f9.co.uk
Is the host 'mesh' a member of a group in your inventory file called 'windows'?

The group needs to exist in your inventory

so assuming you inventory contains

[windows]
mesh

and you group_vars/windows.yml contains the connection parameters listed above?

If it isn't then ansible will assume default connection type, which is ssh.

Hope this helps,

Jon

John Norris

unread,
Jan 28, 2017, 9:00:03 AM1/28/17
to ansible...@googlegroups.com
I actually put the connection parameters in /etc/ansible/hosts under [windows:vars].
Is that still valid?

Trond Hindenes

unread,
Jan 28, 2017, 12:57:31 PM1/28/17
to Ansible Project, jo...@norricorp.f9.co.uk
yes, that's still valid. Here's a valid and working hosts file:

[all]

[all:vars]
ansible_connection=winrm
ansible_port=5986
ansible_winrm_server_cert_validation=ignore
ansible_password=e6PHLue6PHLu
ansible_user=<password>

[windows]
windows1 ansible_host=192.168.99.100

If that's not working its likely an issue on the target server. Have you run the prepare-script?

John Norris

unread,
Jan 30, 2017, 3:34:38 AM1/30/17
to ansible...@googlegroups.com
Hi Trond,
I got it to work by changing the user from administrator.
Many thanks for helping.
Regards,
john


Prajawal Sinhaa

unread,
Mar 3, 2020, 5:02:32 AM3/3/20
to Ansible Project
I am facing the same Issue. I am using basic authentication , should I use kerberos auth? I am trying to connect to my organisation's PC.
Reply all
Reply to author
Forward
0 new messages