Problems with Ansible and WinRM

125 views
Skip to first unread message

Bryan Sanchez

unread,
Apr 30, 2019, 5:08:54 AM4/30/19
to Ansible Project
Hello AnsibleProjectForum, im trying to deploy ansible with winrm module. 


First thing, sorry for my english, im not native english speaker.

Im launching Ansible from Ubuntu to Windows. I have installed the necessary module ( with pip install "pywinrm>=0.3.0" ). 

My purpose is to create a playbook that allow me to deploy and configure a winlogbeat in a remote windows machine. 

For that im trying to connect using user and password with Basic authentication method.

I have nothing at the moment that tells me im connecting correctly, just trying to do a win_ping with ansible command and doesn't work. 

The command is: ansible GROUPNAME -m wing_ping -i INVENTORY/PATH -k 

This is the inventory file: 

    [GROUP]
    172.22.1.129
    [GROUP:vars]
    ansible_user=LocalUsername
    ansible_password=Password
    ansible_connection=winrm
    ansible_winrm_transport=basic
    ansible_port=(im testing between 5985 and 5986 ).

Looking aroung the Internets i found that i can use this variable when im trying to connect via https (port 5986) : ansible_winrm_server_cert_validation=ignore (because it is looking up for a certificate and i dont want to do it by certificate method).

Ansible always says that the server rejected the credentials:

172.22.1.129 | UNREACHABLE! => {
    "changed": false,
    "msg": "ssl: the specified credentials were rejected by the server",
    "unreachable": true
}

Note that the normal ping works.

Can you guys help me out? If you can handle some code examples it would be handy. 

Thank you and sorry again for my English.

Cheers!

Ankit Vashistha

unread,
Apr 30, 2019, 5:50:14 AM4/30/19
to ansible...@googlegroups.com
Can you try adding the following as well and test:

ansible_winrm_message_encryption: auto

Regards,
Ankit


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/7b8b06c1-ce4a-4fb4-ac2c-c4adc0a7ef14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bryan Sanchez

unread,
Apr 30, 2019, 7:02:11 AM4/30/19
to Ansible Project
Hello Ankit, that didn't fix the problem, but my enterprise gave me access to its domain.
Didnt knew they were on domain at first, so i connected via Kerberos and now it works!

Thanks for the fast reply.
Cheers!
To unsubscribe from this group and stop receiving emails from it, send an email to ansible...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages