I can remote into into my windows host machine from another windows machine 
using 

Invoke-Command -ComputerName AnsibleHost1 -ScriptBlock { Get-childitem c:\} 
-credential $cred


I have also tried(not using https):

 > winrm identify -r:http://10.1.11.40:5985/wsman -auth:basic 
-u:administrator -p:password -encoding:utf-8
IdentifyResponse
    ProtocolVersion = http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd
    ProductVendor = Microsoft Corporation
    ProductVersion = OS: 6.2.9200 SP: 0.0 Stack: 3.0
    SecurityProfiles
        SecurityProfileName = 
http://schemas.dmtf.org/wbem/wsman/1/wsman/secprofile/http/basic, 
http://schemas.dmtf.org/
wbem/wsman/1/wsman/secprofile/https/basic, 
http://schemas.dmtf.org/wbem/wsman/1/wsman/secprofile/http/spnego-kerberos, 
h
ttp://schemas.dmtf.org/wbem/wsman/1/wsman/secprofile/https/spnego-kerberos


Im think it has something to do with pywinrm, because when i trying running 
it on my linux machine through python i get the following error:

 >>> import winrm
>>> s = winrm.Session('http://10.1.11.40:5985/wsman', 
auth=('administrator', 'password'))
>>> r = s.run_cmd('ipconfig', ['/all'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/winrm/__init__.py", line 26, 
in run_cmd
    shell_id = self.protocol.open_shell()
  File "/usr/local/lib/python2.7/dist-packages/winrm/protocol.py", line 
103, in open_shell
    rs = self.send_message(xmltodict.unparse(rq))
  File "/usr/local/lib/python2.7/dist-packages/winrm/protocol.py", line 
173, in send_message
    return self.transport.send_message(message)
  File "/usr/local/lib/python2.7/dist-packages/winrm/transport.py", line 
102, in send_message
    raise WinRMTransportError('http', ex.reason)
winrm.exceptions.WinRMTransportError: 500 WinRMTransport. [Errno 22] 
Invalid argument




On Friday, 22 August 2014 14:42:19 UTC+2, Avinash Singh wrote:
>
> Windows 2012 Server.
> Ansible 1.8
>
> I have run the setup script.
>
> On Friday, 22 August 2014 13:07:37 UTC+2, Michael DeHaan wrote:
>>
>> When you say "remote windows machine", what version of Windows, what is 
>> the version of Ansible (ansible --version exact output), and did you run 
>> the setup script above or set it up manually?
>>
>> Thanks!
>>
>>
>>
>>
>> On Fri, Aug 22, 2014 at 3:33 AM, Avinash Singh <[email protected]> 
>> wrote:
>>
>>> Heres a log of my latest error:
>>>
>>> <10.1.11.40> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 
>>> 5986 TO 10.1.11.40
>>> <10.1.11.40> WINRM CONNECT: transport=plaintext endpoint=
>>> https://10.1.11.40:5986/wsman
>>> 10.1.11.40 | FAILED => Traceback (most recent call last):
>>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/ansible-1.8-py2.7.egg/ansible/runner/__init__.py",
>>>  
>>> line 563, in _executor
>>>     exec_rc = self._executor_internal(host, new_stdin)
>>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/ansible-1.8-py2.7.egg/ansible/runner/__init__.py",
>>>  
>>> line 672, 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.8-py2.7.egg/ansible/runner/__init__.py",
>>>  
>>> line 843, 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.8-py2.7.egg/ansible/runner/connection.py",
>>>  
>>> line 44, in connect
>>>     self.active = conn.connect()
>>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/ansible-1.8-py2.7.egg/ansible/runner/connection_plugins/winrm.py",
>>>  
>>> line 132, in connect
>>>     self.protocol = self._winrm_connect()
>>>   File 
>>> "/usr/local/lib/python2.7/dist-packages/ansible-1.8-py2.7.egg/ansible/runner/connection_plugins/winrm.py",
>>>  
>>> line 90, in _winrm_connect
>>>     err_msg = str(exc.args[0])
>>> IndexError: tuple index out of range
>>>
>>>
>>> On Friday, 22 August 2014 09:04:50 UTC+2, Avinash Singh wrote:
>>>>
>>>> I have disabled the firewall.
>>>>
>>>> Output from Host machine when running remoting script:
>>>>
>>>> VERBOSE: Verifying WS-MAN
>>>> VERBOSE: PS remoting is already active and running
>>>> VERBOSE: SSL-based remoting already active
>>>> VERBOSE: basic auth already enabled
>>>> Ok.
>>>>
>>>>
>>>> VERBOSE: PS Remoting successfully setup for AnsibleEnter code here...
>>>>
>>>>
>>>>  This is the error on the controller:
>>>>
>>>>
>>>> <10.1.11.40> ESTABLISH CONNECTION FOR USER: root
>>>> <10.1.11.40> REMOTE_MODULE win_ping
>>>> <10.1.11.40> EXEC ['ssh', '-C', '-tt', '-vvv', '-o', 
>>>> 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 
>>>> 'ControlPath=/home/avinashs/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 
>>>> 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 
>>>> 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey',
>>>>  
>>>> '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', 
>>>> '10.1.11.40', 
>>>> "/bin/sh -c 'mkdir -p 
>>>> $HOME/.ansible/tmp/ansible-tmp-1408690690.7-187551343997386 
>>>> && echo $HOME/.ansible/tmp/ansible-tmp-1408690690.7-187551343997386'"]
>>>> EXEC previous known host file not found for 10.1.11.40
>>>> 10.1.11.40 | FAILED => SSH encountered an unknown error. The output was:
>>>> OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
>>>> debug1: Reading configuration data /etc/ssh/ssh_config
>>>> debug1: /etc/ssh/ssh_config line 19: Applying options for *
>>>> debug1: auto-mux: Trying existing master
>>>> debug1: Control socket "/home/avinashs/.ansible/cp/
>>>> ansible-ssh-10.1.11.40-22-root" does not exist
>>>> debug2: ssh_connect: needpriv 0
>>>> debug1: Connecting to 10.1.11.40 [10.1.11.40] port 22.
>>>> debug2: fd 3 setting O_NONBLOCK
>>>> debug1: connect to address 10.1.11.40 port 22: Connection refused
>>>> ssh: connect to host 10.1.11.40 port 22: Connection refused
>>>>
>>>>
>>>>
>>>> On Thursday, 21 August 2014 21:01:37 UTC+2, Paul Durivage wrote:
>>>>>
>>>>> You said you're getting a connection refused, so check the firewall 
>>>>> and winrm settings on the Windows machine.  
>>>>>
>>>>> There's an example script (https://github.com/ansible/
>>>>> ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1) 
>>>>> that takes care of WinRM making sure the box allows remote powershell 
>>>>> exec, 
>>>>> among other things.  Likely you're missing a step preparing the Windows 
>>>>> machine to accept remote winrm connections.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Aug 21, 2014 at 1:29 PM, Avinash Singh <[email protected]> 
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I have installed ansible on my linux controller, however I am unable 
>>>>>> to win_ping my windows host machine.
>>>>>> The controller and host are virtual machines hosted on my physical 
>>>>>> machine.
>>>>>>
>>>>>> I am able to ping each machine in both directions from cmd prompt and 
>>>>>> the terminal, to verify that the machines can see each other.
>>>>>>
>>>>>> I have followed all the steps from here :http://docs.ansible.com/
>>>>>> intro_windows.html
>>>>>>
>>>>>> When running the command below I get a connection refused.
>>>>>>
>>>>>> ansible windows -i /etc/anisible/hosts -m win_ping --ask-vault-pass -vvvv
>>>>>>
>>>>>> I have also tried using a playbook. However I get some cows :) and 
>>>>>> connection could be established.
>>>>>>
>>>>>>    ansible-playbook site.yml
>>>>>>
>>>>>> with the following site.xml contents:
>>>>>> ---
>>>>>> -host: windows
>>>>>>  remote_user: Administrator
>>>>>>  vars:
>>>>>>
>>>>>> ansible_ssh_user: Administrator
>>>>>> ansible_ssh_pass: test
>>>>>> ansible_ssh_port: 5986
>>>>>> ansible_connection: winrm
>>>>>>
>>>>>> tasks:
>>>>>>   - action: win_ping
>>>>>>
>>>>>> Is there something that I am missing?
>>>>>>
>>>>>> -- 
>>>>>> 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/3f8137c9-082d-4591-be0f-
>>>>>> 9889847b78b5%40googlegroups.com 
>>>>>> <https://groups.google.com/d/msgid/ansible-project/3f8137c9-082d-4591-be0f-9889847b78b5%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>
>>>>>  -- 
>>> 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/4f01287f-50cc-4233-b100-7d11e101b8e9%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/ansible-project/4f01287f-50cc-4233-b100-7d11e101b8e9%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 
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/d73e6bcc-c441-4816-9ae2-15d663bae0df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to