So ... you are getting connection refused.  So winrm is connecting but 
isn't happy with something.
Have a look in the event logs on the windows box to see if there is 
anything appearing when you attempt to connect.

Actually I think its possible that the problem is your inventory file.  I 
suggest you remove the spaces in

      ansible_user= voiceqa

      ansible_password = abcdef


So they look like this:


      ansible_user=voiceqa

      ansible_password=abcdef

Give that a try and let us know how you get on.

Jon

On Monday, August 22, 2016 at 7:17:34 PM UTC+1, Deep18 wrote:
>
> Hi,
>
> I am trying to use ansible to controla windows 10 desktop VM in my lab and 
> cannot seem to get past the connection error.Appreciate your help here.
>
>
> Here is my setup:
>
> MacBook is the control host and trying to connect to a windows10 desktop 
> VM. I went through and followed all instructions in the ansible doc to 
> enable remotePowershell on windows VM, turned OFF firewall on the windows 
> VM.The windows VM is not part of any domain.
>
>
> My inventory file:
>
> [windows]
>
> 10.203.189.4
>
> [windows:vars]                                      #group variables and 
> values as a string
>
>       ansible_connection=winrm 
>
>       ansible_user= voiceqa
>
>       ansible_password = abcdef
>
>       ansible_port=5986
>
>       ansible_winrm_server_cert_validation= ignore
>
>
> I get the following error:
>
>
> $ ansible windows --inventory-file=./hosts  -m win_ping -vvvvv
>
> No config file found; using defaults
>
> Loaded callback minimal of type stdout, v2.0
>
> <10.203.189.4> ESTABLISH WINRM CONNECTION FOR USER: voiceqa on PORT 5986 
> TO 10.203.189.4
>
> <10.203.189.4> WINRM CONNECT: transport=ssl endpoint=
> https://10.203.189.4:5986/wsman
>
> <10.203.189.4> WINRM CONNECTION ERROR: 
> HTTPSConnectionPool(host='10.203.189.4', port=5986): Max retries exceeded 
> with url: /wsman (Caused by 
> NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection
>  
> object at 0x10e61c8d0>: Failed to establish a new connection: [Errno 61] 
> Connection refused',))
>
> Traceback (most recent call last):
>
>   File 
> "/Users/dnveer/venv/vqp/lib/python2.7/site-packages/ansible/plugins/connection/winrm.py",
>  
> line 134, in _winrm_connect
>
>     protocol.send_message('')
>
>   File 
> "/Users/dnveer/venv/vqp/lib/python2.7/site-packages/winrm/protocol.py", 
> line 207, in send_message
>
>     return self.transport.send_message(message)
>
>   File 
> "/Users/dnveer/venv/vqp/lib/python2.7/site-packages/winrm/transport.py", 
> line 173, in send_message
>
>     response = self.session.send(prepared_request, 
> timeout=self.read_timeout_sec)
>
>   File 
> "/Users/dnveer/venv/vqp/lib/python2.7/site-packages/requests/sessions.py", 
> line 585, in send
>
>     r = adapter.send(request, **kwargs)
>
>   File 
> "/Users/dnveer/venv/vqp/lib/python2.7/site-packages/requests/adapters.py", 
> line 467, in send
>
>     raise ConnectionError(e, request=request)
>
> ConnectionError: HTTPSConnectionPool(host='10.203.189.4', port=5986): Max 
> retries exceeded with url: /wsman (Caused by 
> NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection
>  
> object at 0x10e61c8d0>: Failed to establish a new connection: [Errno 61] 
> Connection refused',))
>
>
> 10.203.189.4 | FAILED! => {
>
>     "failed": true, 
>
>     "msg": "ssl: HTTPSConnectionPool(host='10.203.189.4', port=5986): Max 
> retries exceeded with url: /wsman (Caused by 
> NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection
>  
> object at 0x10e61c8d0>: Failed to establish a new connection: [Errno 61] 
> Connection refused',))"
>
> }
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3d936964-d753-4105-b97f-80eb10051e52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to