Unable to do basic win_ping from CentOS7 to Windows 2012

If you have configured WinRM using the ConfigureRemotingForAnsible.ps1 script I would highly advise you to use HTTPS over port 5986 instead of HTTP. For one HTTP is sent over in cleartext and your credentials can be seen by anyone listening in. The other warning you are getting is because the cert validation variable is not correct, it should be ansible_winrm_server_cert_validation.

Change your inventory to be

ansible_user: ansibleadmin
ansible_password: Passw0rd
ansible_port: 5986
ansible_connection: winrm
ansible_winrm_transport: ntlm
ansible_winrm_server_cert_validation: ignore

Thanks

Jordan

No worries, glad I could help.

Its odd that you are getting the insecure request warnings - I am wondering if you are running ansible from a folder with a different ansible.cfg in it perhaps, as the ansible_winrm_server_cert_validation: ignore doesn’t seem to be taking effect.

Please share your playbook or command line

It is working when I kept port: 5985