I've reinstalled everything and am still having trouble getting win_ping to work. Here is my info: Fedora 20 Ansible 1.7.1 Remote node running windows 7 The WinRM script by Trond runs without errors on the remote node Control and Remote Machines are both on Lan with common domain w/o firewalls So far as I can tell I've installed everything on control and remote machine as described in documentation
My inventory file contains [windows] 123.123.123.123 My windows.yml file is in the group_vars directory and contains ansible_ssh_user: Administrator ansible_ssh_pass: ansiblepw ansible_ssh_port: 5986 ansible_connection: winrm Should this file begin with "---"? Can you tell what I'm doing wrong? Do you need any more information? [ansmgr@dhcp1-59-159 ansible]$ ansible windows -m win_ping --ask-pass -vvvv SSH password: <123.123.123.123> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 123.123.123.123 <123.123.123.123> WINRM CONNECT: transport=plaintext endpoint=https://123.123.123.123:5986/wsman <123.123.123.123> WINRM CONNECTION ERROR: 500 WinRMTransport. [Errno 104] Connection reset by peer <123.123.123.123> WINRM CONNECT: transport=plaintext endpoint=http://123.123.123.123:5986/wsman 123.123.123.123 | FAILED => Traceback (most recent call last): File "/etc/ansible/lib/ansible/runner/__init__.py", line 549, in _executor exec_rc = self._executor_internal(host, new_stdin) File "/etc/ansible/lib/ansible/runner/__init__.py", line 707, in _executor_internal return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args) File "/etc/ansible/lib/ansible/runner/__init__.py", line 870, in _executor_internal_inner conn = self.connector.connect(actual_host, actual_port, actual_user, actual_pass, actual_transport, actual_private_key_file) File "/etc/ansible/lib/ansible/runner/connection.py", line 44, in connect self.active = conn.connect() File "/etc/ansible/lib/ansible/runner/connection_plugins/winrm.py", line 132, in connect self.protocol = self._winrm_connect() File "/etc/ansible/lib/ansible/runner/connection_plugins/winrm.py", line 86, in _winrm_connect protocol.send_message('') File "/usr/lib/python2.7/site-packages/winrm/protocol.py", line 173, in send_message return self.transport.send_message(message) File "/usr/lib/python2.7/site-packages/winrm/transport.py", line 76, in send_message response = urlopen(request, timeout=self.timeout) File "/usr/lib64/python2.7/urllib2.py", line 127, in urlopen return _opener.open(url, data, timeout) File "/usr/lib64/python2.7/urllib2.py", line 404, in open response = self._open(req, data) File "/usr/lib64/python2.7/urllib2.py", line 422, in _open '_open', req) File "/usr/lib64/python2.7/urllib2.py", line 382, in _call_chain result = func(*args) File "/usr/lib64/python2.7/urllib2.py", line 1216, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib64/python2.7/urllib2.py", line 1189, in do_open r = h.getresponse(buffering=True) File "/usr/lib64/python2.7/httplib.py", line 1045, in getresponse response.begin() File "/usr/lib64/python2.7/httplib.py", line 409, in begin version, status, reason = self._read_status() File "/usr/lib64/python2.7/httplib.py", line 365, in _read_status line = self.fp.readline(_MAXLINE + 1) File "/usr/lib64/python2.7/socket.py", line 476, in readline data = self._sock.recv(self._rbufsize) error: [Errno 104] Connection reset by peer On Saturday, June 28, 2014 7:16:15 AM UTC-5, Trond Hindenes wrote: > > I'm having trouble setting Ansible with WinRM. Here's my environment: > 10.10.50.4 - Win1 - the windows computer im trying to connect to from > Ansible (i've added this to the hosts file on my ansible host) > 10.10.50.6 - Win2 - another windows host > 10.10.50.5 - Ansible host (running Ubuntu 12.04) > > On Win1 I have setup a remoting endpoint using SSL (btw, the doc doesn't > state wether SSL is required or recommended. non-ssl http connections > should be an option imho) > From 10.10.50.6 I can initiate a SSL-based PSremoting session to > 10.10.50.4, which should prove that the remoting endpoint and ssl is > correctly setup: > > $cred = Get-credential > $options = New-PSSessionOption -SkipCACheck -SkipCNCheck > -SkipRevocationCheck > New-PSSession -ComputerName "10.10.50.4" -UseSSL -Credential $cred > -SessionOption $options > > This opens a session without warnings. > > Here's my hosts file in ansible: > azur...@th-ansible10:~/AnsibleTest/pstest$ <javascript:> cat hosts > [windows] > Win1 > > and here's my windows groupvar file: > azur...@th-ansible10:~/AnsibleTest/pstest/group_vars$ <javascript:> cat > windows.yml > # it is suggested that these be encrypted with ansible-vault: > # ansible-vault edit group_vars/windows.yml > ansible_ssh_user: thadministrator > ansible_ssh_pass: <password> > ansible_ssh_port: 5986 > ansible_connection: winrm > > Here's the command I'm attempting: > azur...@th-ansible10:~/AnsibleTest/pstest$ <javascript:> ansible windows > -i hosts -m win_ping -vvvv > <win1> ESTABLISH WINRM CONNECTION FOR USER: thadministrator on PORT 5986 > TO win1 > <win1> WINRM CONNECT: transport=plaintext endpoint=https://win1:5986/wsman > <win1> WINRM CONNECTION ERROR: Bad HTTP response returned from server. > Code 401 > <win1> WINRM CONNECT: transport=plaintext endpoint=http://win1:5986/wsman > win1 | FAILED => Traceback (most recent call last): > File > "/usr/local/lib/python2.7/dist-packages/ansible-1.7-py2.7.egg/ansible/runner/__init__.py", > > line 526, in _executor > exec_rc = self._executor_internal(host, new_stdin) > File > "/usr/local/lib/python2.7/dist-packages/ansible-1.7-py2.7.egg/ansible/runner/__init__.py", > > line 628, in _executor_internal > return self._executor_internal_inner(host, self.module_name, > self.module_args, inject, port, complex_args=complex_args) > File > "/usr/local/lib/python2.7/dist-packages/ansible-1.7-py2.7.egg/ansible/runner/__init__.py", > > line 799, in _executor_internal_inner > conn = self.connector.connect(actual_host, actual_port, actual_user, > actual_pass, actual_transport, actual_private_key_file) > File > "/usr/local/lib/python2.7/dist-packages/ansible-1.7-py2.7.egg/ansible/runner/connection.py", > > line 34, in connect > self.active = conn.connect() > File > "/usr/local/lib/python2.7/dist-packages/ansible-1.7-py2.7.egg/ansible/runner/connection_plugins/winrm.py", > > line 130, in connect > self.protocol = self._winrm_connect() > File > "/usr/local/lib/python2.7/dist-packages/ansible-1.7-py2.7.egg/ansible/runner/connection_plugins/winrm.py", > > line 86, in _winrm_connect > protocol.send_message('') > File "/usr/local/lib/python2.7/dist-packages/winrm/protocol.py", line > 160, in send_message > return self.transport.send_message(message) > File "/usr/local/lib/python2.7/dist-packages/winrm/transport.py", line > 63, in send_message > response = urlopen(request, timeout=self.timeout) > File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen > return _opener.open(url, data, timeout) > File "/usr/lib/python2.7/urllib2.py", line 400, in open > response = self._open(req, data) > File "/usr/lib/python2.7/urllib2.py", line 418, in _open > '_open', req) > File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain > result = func(*args) > File "/usr/lib/python2.7/urllib2.py", line 1207, in http_open > return self.do_open(httplib.HTTPConnection, req) > File "/usr/lib/python2.7/urllib2.py", line 1180, in do_open > r = h.getresponse(buffering=True) > File "/usr/lib/python2.7/httplib.py", line 1030, in getresponse > response.begin() > File "/usr/lib/python2.7/httplib.py", line 407, in begin > version, status, reason = self._read_status() > File "/usr/lib/python2.7/httplib.py", line 365, in _read_status > line = self.fp.readline() > File "/usr/lib/python2.7/socket.py", line 447, in readline > data = self._sock.recv(self._rbufsize) > error: [Errno 104] Connection reset by peer > > > I don't know why this is happening, and I realize that this is very much > beta code. However, there are some (potentially important) points left out > from the doc: > 1. Is SSL required, or should this work using http-based connections? > 2. What requirements are there on the ssl cert being used? Does the > ansible node need the public key of the cert being used on the windows > side? > > > -- 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/0f0141af-94a9-4a8f-b5f1-5b40d12428dd%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
