I’m trying to use Ansible for a Windows host. I followed the instructions, but I’m getting an error when I try to run anything simple:
ansible inventory -m setup or ansible inventory -m wing_ping
Host IP| UNREACHABLE! => {
“changed”: false,
“msg”: “ssl: HTTPSConnectionPool(host=‘Host IP’, port=5986): Max retries exceeded with url: /wsman (Caused by NewConnectionError(‘<urllib3.connection.VerifiedHTTPSConnection object at 0xbc8550>: Failed to establish a new connection: [Errno 111] Connection refused’,))”,
“unreachable”: true
}
This is just a workgroup so local accounts. Any ideas? Thanks
‘Connection refused’ usually means you have established a connection to the machine, but its not happy with your attempt to log in.
I suggest you run ansible with -vvvvv which will give you a bit more debug information and check that the user you are connecting with is the one you expect.
Also worth checking the event log on the windows box to see if there’s any information about why the connection was refused.
Double check you’ve run all the setup instructions (including running the configure for remoting script on the remote windows machine).
If you are still stuck, connect to the windows box and run the following as administrator