when running the ansible windows -i hosts -m win_ping i am getting below error however if i am trying for other windows host machine i am getting success message …
please help me out why it is so…
Is it some thing to do with firewall on windows host machine ?
10.0.46.197 | UNREACHABLE! => {
“changed”: false,
“msg”: “ssl: HTTPSConnectionPool(host=‘10.0.46.197’, port=5986): Max retries exceeded with url: /wsman (Caused by NewConnectionError(‘<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x36550d0>: Failed to establish a new connection: [Errno 111] Connection refused’,))”,
This looks like your WinRM listener isn’t configured properly or something is blocking your Ansible host from connecting over that port. You can verify what listeners are online by running this command on your Windows host
winrm enumerate winrm/config/listener
You should see a listener that is running over Port 5986 and HTTPS as the transport.You can use https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 to setup a HTTPS listener with a self signed certificate for testing. Bear in mind this shouldn’t be used in a production aspect as it opens up pretty everything it can to get you working and you should use a custom script specific for your process.