Windows Host Unreachable

Hello,

I’m getting the following error when trying to win_ping my windows host:

Command:
ansible VMs -m win_ping

Response:
xx.xx.xx.xxx | UNREACHABLE! => {
“changed”: false,
“msg”: “basic: HTTPSConnectionPool(host=‘xx.xx.xx.xxx’, port=5986): Max retries exceeded with url: /wsman (Caused by ProxyError(‘Cannot connect to proxy.’, error(‘Tunnel connection failed: 403 Forbidden’,)))”,
“unreachable”: true
}

Can please someone help me understand where might the problem be?

Followed all steps for both Control node (Redhat server 7) and Windows 7 controlled node.

You help would be deeply appreciated.

From the error message it looks like there is a network proxy being used.
If possible I would try and set things up to not use a proxy to start with so you can rule out whether the proxy itself is breaking the communication.
You might wish to try the psrp connection plugin as that has options to avoid proxy.
https://docs.ansible.com/ansible/latest/plugins/connection/psrp.html

A couple of useful pages if you need to get into debugging winrm connection
https://www.hurryupandwait.io/blog/understanding-and-troubleshooting-winrm-connection-and-authentication-a-thrill-seekers-guide-to-adventure
https://www.bloggingforlogging.com/2018/10/14/windows-host-through-ssh-bastion-on-ansible/
Also the trouble shooting guide here is helpful too:
https://docs.ansible.com/ansible/latest/user_guide/windows_setup.html#common-winrm-issues

Hope this helps,

Jon

Thank you so much for your precious help. I’ll give it a try with the links you referred.

I’ll let you know the result afterwards.

Kind regards,
Marco