Re: [ansible-project] Re: Ansible Windows Deployment - 'Connection aborted.', error(104, 'Connection reset by peer')

2020-08-17 Thread Tony Wong
i dont understand what this mean

You need both the hotfix and the registry keys set for the connection to
break like this, having one or the other is not enough. A

On Sun, Aug 16, 2020 at 5:40 PM Tony Wong  wrote:

> I have same problem. I enabled winrm over https and i can see it listen to
> 5986. but a simple win_ping is not working
>
> On Monday, September 17, 2018 at 2:46:26 PM UTC-7 jbor...@gmail.com wrote:
>
>> You need both the hotfix and the registry keys set for the connection to
>> break like this, having one or the other is not enough. Another thing to
>> note is that this only applies to Server 2008, the 2008 R2 edition works
>> just fine with TLSv1.2. So if this is the original 2008 version (and not
>> 2008 R2) verify that TLS1.2 isn't enabled in the registry for the server
>> side.
>>
>> Thanks
>>
>> Jordan
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/CmgTs1NbvZE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/1f417e6f-d87f-44e7-9a7e-60ff9fc57765n%40googlegroups.com
> 
> .
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CALmkhkoiwzdYFZXazGWoo1tz5v5dCY2hsLFDz%2Byruk3P46jFzg%40mail.gmail.com.


Re: [ansible-project] Re: ansible windows inventory get hostname/user/password ad-hoc from external script

2020-03-31 Thread Gregory Storme
I've managed to write a workaround, by writing a playbook which runs
the get-admin-credential command task, with "delegate_to: localhost".
>From this I build a dictionary with the parsed values for
host/login/password from the command output, and in the ansible inventory
file I do a hostvars lookup of these values.

An inventory plugin could also work, thanks for the tip I'll check that out
later.


On Thu, Mar 26, 2020 at 9:49 AM 'J Hawkesworth' via Ansible Project <
ansible-project@googlegroups.com> wrote:

> Would constructing your own lookup plugin be an option?
>
> There seem to be lots of lookup plugins that look things up in various
> kinds of vaults:
> https://docs.ansible.com/ansible/latest/plugins/lookup.html#plugin-list
> Could you create one of your own.
>
> If you created an inventory plugin, rather than an older style dynamic
> inventory script, I believe the inventory plugins can make use of the
> internal cache, so you might be able to cache credentials for a little
> while, which might speed things up, but I'd be inclined to see if you could
> create your own lookup plugin.
>
> Hope this helps,
>
> Jon
>
> On Tuesday, March 17, 2020 at 7:49:01 PM UTC, Gregory Storme wrote:
>>
>> Hi,
>>
>> We have a couple of hundred Windows hosts, with each host having
>> different credentials (both login and password), which are stored in an
>> on-premise, in-house developed "vault" system.
>> A dream scenario would be to install win32-openssh on all of them, and
>> use ssh key authentication :) however until there's MSI(X) support for
>> win32-openssh and/or it goes out of beta, this is not an option.
>>
>> We have an API to access our vault, which returns the
>> hostname/username/password for the host.
>> As a workaround now, I've written a simple wrapper for ansible-playbook
>> which works, but the disadvantage is that each host is a new playbook run.
>> I'm looking for a solution to run a playbook, and where ansible polls the
>> hostname/username/password for each alias in the ansible inventory.
>> Tried looking to patch the winrm.py connection plugin, but this didn't
>> work, and I think it would poll for each task that's executed by the winrm
>> plugin instead of only once?
>>
>> Solution I'm using now:
>>
>> ansible hosts file:
>>
>> [windows]
>> L001
>> L002
>> L003
>>
>> ansible-playbook wrapper:
>>
>> #!/bin/bash
>>
>> CONNECTION="ansible_connection=winrm ansible_port=5985
>> ansible_winrm_transport=credssp"
>>
>> for host in `cat ~/.ansible/hosts`
>>   do
>> SECRET=`/opt/scripts/vault-functions/bin/console
>> app:get-admin-credential --tag=$host`
>> HOST=`echo $SECRET | cut -d ';' -f1`
>> LOGIN=`echo $SECRET | cut -d ';' -f2`
>> DOMAIN=`echo $SECRET | cut -d ';' -f3`
>> PWD=`echo $SECRET | cut -d ';' -f4`
>>
>> if [ -z "$DOMAIN" ]; then
>>   ansible-playbook -i ~/.ansible/hosts ~/.ansible/windows.yml -e
>> "ansible_host=$HOST ansible_user=$LOGIN ansible_password=$PWD $CONNECTION"
>> else
>>   ansible-playbook -i ~/.ansible/hosts ~/.ansible/windows.yml -e
>> "ansible_host=$HOST ansible_user=$LOGIN@$DOMAIN ansible_password=$PWD
>> $CONNECTION"
>> fi
>>   done
>>
>> This works, but as stated before this runs an ansible-playbook for each
>> host.
>> Could someone point me in the right direction on how to be able to run an
>> ansible-playbook, upon which ansible does a lookup of the
>> ansible_hostname/ansible_user/ansible-password during the connection phase
>> to the host?
>>
>> Important detail, once a secret is requested from our vault, the password
>> will be reset within a couple of hours. So it's not possible for us to
>> build a static (encrypted) inventory.
>> Building a dynamic inventory is also not desired, because of the large
>> amount of hosts and the time it takes to request the credentials, this
>> would take too long and by the time it's finished, it's possible the
>> credentials of the first hosts have already been reset.
>>
>> So I'm looking for something that can pull data ad-hoc upon the ansible
>> connection, like the wrapper above does, but whilst staying in 1 playbook
>> run ... tips are much appreciated!
>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/bc28M8NwuvA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/42d09dda-7d9d-440e-b5dd-cb3612990aea%40googlegroups.com
> 
> .
>

-- 
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 
t

Re: [ansible-project] Re: [Ansible windows] "kerberos: authGSSClientStep() failed: (('Unspecified GSS failure. Minor code may provide more information', 851968), ('Generic error (see e-text)', -176532

2018-08-28 Thread Jordan Borean
arcfour is RC4 which isn't supported, problematic, and a broken encryption 
standard. You should be using at least AES, a list of encryption types in 
krb5 can be found here 
http://web.mit.edu/kerberos/krb5-1.12/doc/admin/enctypes.html#enctype-compatibility.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a7d28a9e-c3c5-448a-85a6-6e3fe1bf6a92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: [Ansible windows] "kerberos: authGSSClientStep() failed: (('Unspecified GSS failure. Minor code may provide more information', 851968), ('Generic error (see e-text)', -176532

2018-08-28 Thread Jeremie Levy
Hello Jordan
I moved from https to http
I removed the des kerberos options:
# default_tgs_enctypes = des-cbc-crc arcfour-hmac-md5
 default_tgs_enctypes = arcfour-hmac-md5
# default_tkt_enctypes = arcfour-hmac-md5 des-cbc-crc
 default_tkt_enctypes = arcfour-hmac-md5
# preferred_preauth_types = des-cbc-crc


And here is the result of the run - i have to admit this is not helping me
much...

# KRB5_TRACE=/dev/stdout ansible-playbook playbooks/win_test.yml --limit
scststhost67.usa.company.com -


ansible-playbook 2.6.2

  config file = /ansible/scripts/ansible.cfg

  configured module search path =
[u'/usr/local/lib/python2.7/dist-packages/ara/plugins/modules']

  ansible python module location =
/usr/lib/python2.7/dist-packages/ansible

  executable location = /usr/bin/ansible-playbook

  python version = 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0
20160609]
Using /ansible/scripts/ansible.cfg as config file

setting up inventory plugins

Parsed /ansible/scripts/inventory/windows.yml inventory source with yaml
plugin
Loading callback plugin default of type stdout, v2.0 from
/usr/lib/python2.7/dist-packages/ansible/plugins/callback/default.pyc

Loading callback plugin ara of type notification, v2.0 from
/usr/local/lib/python2.7/dist-packages/ara/plugins/callbacks/log_ara.pyc


PLAYBOOK: win_test.yml
*
1 plays in playbooks/win_test.yml



PLAY [windows]
*
META: ran handlers


Trying secret
FileVaultSecret(filename='/nfs/site/disks/home30/ansible/.ssh/ansible_vault.txt')
for vault_id=default

TASK [Simple Ping]
*
task path: /ansible/scripts/playbooks/win_test.yml:5

Using module file
/usr/lib/python2.7/dist-packages/ansible/modules/windows/win_ping.ps1

 ESTABLISH WINRM CONNECTION FOR USER:
usa_ansi...@usa.company.com on PORT 5986 TO scststhost67.usa.company.com

checking if winrm_host scststhost67.usa.company.com is an IPv6 address


calling kinit with pexpect for principal usa_ansi...@usa.company.com


[5574] 1535488714.966934: Retrieving usa_ansi...@usa.company.com from
FILE:/etc/krb5/user/30254/client.keytab (vno 0, enctype 0) with result:
2/Key table file '/etc/krb5/user/30254/client.keytab' not found


[5574] 1535488714.967925: Retrieving usa_ansi...@usa.company.com from
FILE:/etc/krb5/user/30254/client.keytab (vno 0, enctype 0) with result:
2/Key table file '/etc/krb5/user/30254/client.keytab' not found


[5574] 1535488714.968917: Retrieving usa_ansi...@usa.company.com from
FILE:/etc/krb5/user/30254/client.keytab (vno 0, enctype 0) with result:
2/Key table file '/etc/krb5/user/30254/client.keytab' not found


[5574] 1535488714.969845: Retrieving usa_ansi...@usa.company.com from
FILE:/etc/krb5/user/30254/client.keytab (vno 0, enctype 0) with result:
2/Key table file '/etc/krb5/user/30254/client.keytab' not found


[5574] 1535488714.970790: Retrieving usa_ansi...@usa.company.com from
FILE:/etc/krb5/user/30254/client.keytab (vno 0, enctype 0) with result:
2/Key table file '/etc/krb5/user/30254/client.keytab' not found


[5574] 1535488714.974593: Retrieving usa_ansi...@usa.company.com from
FILE:/etc/krb5/user/30254/client.keytab (vno 0, enctype 0) with result:
2/Key table file '/etc/krb5/user/30254/client.keytab' not found


[5574] 1535488714.975957: Retrieving usa_ansi...@usa.company.com from
FILE:/etc/krb5/user/30254/client.keytab (vno 0, enctype 0) with result:
2/Key table file '/etc/krb5/user/30254/client.keytab' not found


[5574] 1535488714.976891: Retrieving usa_ansi...@usa.company.com from
FILE:/etc/krb5/user/30254/client.keytab (vno 0, enctype 0) with result:
2/Key table file '/etc/krb5/user/30254/client.keytab' not found


[5574] 1535488714.979603: Getting credentials usa_ansi...@usa.company.com
-> HTTP/scststhost67.usa.company@usa.company.com using ccache
FILE:/tmp/tmpa0pCw0


[5574] 1535488714.979722: Retrieving usa_ansi...@usa.company.com -> HTTP/
scststhost67.usa.company@usa.company.com from FILE:/tmp/tmpa0pCw0 with
result: -1765328243/Matching credential not found


[5574] 1535488714.979790: Retrieving usa_ansi...@usa.company.com -> krbtgt/
usa.company@usa.company.com from FILE:/tmp/tmpa0pCw0 with result:
0/Success


[5574] 1535488714.979801: Starting with TGT for client realm:
usa_ansi...@usa.company.com -> krbtgt/usa.company@usa.company.com

[5574] 1535488714.979809: Requesting tickets for HTTP/
scststhost67.usa.company@usa.company.com, referrals on

[5574] 1535488714.979835: Generated subkey for TGS request: rc4-hmac/DA64


[5574] 1535488714.979855: etypes requested in TGS request: rc4-hmac


[5574] 1535488714.979986: Encoding request body and padata into FAST
r

Re: [ansible-project] Re: Ansible windows patch trouble: Need help for Win Patch Automation using Ansible

2018-05-24 Thread Kanhaiya Ashtekar
I have installed and created Virtualenv.
Installed pywinrm and this time with no errors.
I will get back over this to report how things worked ahead later.
I feel blessed reaching out here!


On Thu, May 24, 2018 at 3:20 PM Jordan Borean  wrote:

> There is a conflict between a system package and pip trying to install
> another package which in Pip 10 it doesn't handle properly. You can do
> either of the following
>
>- Use a virtualenv and run Ansible from there
>
> https://stackoverflow.com/questions/49916736/how-to-properly-handle-conflicting-distutils-libraries-with-pip
>- Install the packages for just the user "pip install pywinrm --user"
>- Skip the install of requests and continue to use the distuil
>packaged version "pip install pywinrm --ignore-installed"
>
> That's what I would recommend you try
>
> Thanks
>
> Jordan
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/17490ede-03b5-4951-82cb-01cc5eded027%40googlegroups.com
> 
> .
> 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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAHmTTEu3BGVqtkwY5LtUwnem5%3D161PNP5juAyr-2zo_BKK5mQw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Ansible windows modules

2016-09-07 Thread Takeshi Kuramochi
Hi Stavris,

I am not familiar with DISM tool then I have not tried this workaround yet.
For example, if the system has already the KB, this task does nothing,
on the other hands this system does not have the KB it should be fixed
the KB by this task ( it called idempotence ).
I would like to run it in offline after copy already the KB has been
downloaded to that system and expand.


Thank you.

Takeshi,

2016-09-07 1:38 GMT+09:00 Stavros :
> Hello Takeshi,
>
> what do you actually mean by asking if the workaround has idempotence? That
> you run this and nothing changes/happens on the target host?
>
> If you tried it so far, then you can see if the .Net Framework is installed
> only by searching the installed Windows updates. There you will find an
> update with the KB number according to the Windows OS (2012 or 8.1 or ...)
> version that your target host has.
>
> Best Regards
> Stavros
>
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/0ee7135b-74b7-4305-b46a-24565dcbe6b3%40googlegroups.com.
>
> 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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAOpn5sRzw8vNqFQmtb2ox%2BTm%3DHXS4giPmjg4kr7G7DzADWb5Lw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Ansible windows modules

2016-09-06 Thread Stavros
Hello Takeshi,

what do you actually mean by asking if the workaround has idempotence? That 
you run this and nothing changes/happens on the target host?

If you tried it so far, then you can see if the .Net Framework is installed 
only by searching the installed Windows updates. There you will find an 
update with the KB number according to the Windows OS (2012 or 8.1 or ...) 
version that your target host has.

Best Regards
Stavros


-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0ee7135b-74b7-4305-b46a-24565dcbe6b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Ansible windows modules

2016-09-05 Thread Takeshi Kuramochi
Hello Stavos,

I would like to run the ansible to use your workaround for ms patch.
By the way, can your workaround have Idempotence ?

BestRegards,

Takeshi



2016-02-29 18:36 GMT+09:00 Stavros :
> Hi Quang,
>
> you can also try to extract the x64-Windows8.1-KB2934520-x64.msu, which will
> give you the Windows8.1-KB2934520-x64.cab. For the installation try this:
>
> DISM.exe /Online /Add-Package
> /PackagePath:C:\Temp\Windows8.1-KB2934520-x64.cab /NoRestart /Quiet
>
>
> You'll have to reboot the server after the installation, so it's up to you
> to set the /NoRestart parameter...or not..
>
> Stavros
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/6d0ce3c3-39e5-442a-8a24-f949c11186e3%40googlegroups.com.
>
> 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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAOpn5sRwANgKzSonMna8hiVJ_0r2mC3Ox5a8OdC95NUBCo9MfA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Ansible Windows

2014-11-20 Thread Peter Daly-Dickson
I installed ansible from source, and it now works a treat!

*☿* |staging:e38026ddcaae ✗| → ansible -i ./provisioning/hosts production 
-m win_ping

54.67.74.52 | success >> {

"changed": false, 

"ping": "pong"

}


Thanks for ansible, and for great resources to fix issues.

cheers

P.

On Saturday, 25 October 2014 20:47:20 UTC+1, Chris Church wrote:
>
> That IndexError has been fixed in ansible devel.  It's not really a 
> pywinrm issue, but an ansible issue in trying to handle the HTTPError from 
> pywinrm.
>
> It happens when the HTTPError from urllib2 isn't a file-like object 
> (despite what the docs say in 
> https://docs.python.org/2/library/urllib2.html#urllib2.HTTPError).
>
>
> On Mon, Oct 20, 2014 at 4:58 PM, Michael DeHaan  > wrote:
>
>> This is probably a good error to file upstream with winrm, such that on 
>> this error it can present something better to the user.
>>
>> We could catch it, but an IndexError is the wrong sort of exception to be 
>> catching here.
>>
>>
>>
>> On Sun, Oct 19, 2014 at 2:44 PM, Trond Hindenes > > wrote:
>>
>>> Have you prepared your Windows nodes as per documentation? Basically, 
>>> yuu need to enable WinRM connections over HTTPS, and enable Baisc auth for 
>>> your WinRm endpoint. Look at the documentation, there's a script that will 
>>> do those things for you. I've uploaded a newer version of that script here: 
>>> https://gist.github.com/trondhindenes/2cd162d4b17c2c28ec40
>>>
>>> _Trond
>>>
>>>
>>> On Friday, October 17, 2014 5:02:06 PM UTC+2, Bryan Cochrane wrote:
>>>
 I am trying to setup windows remoting for ansible.

 I have Ansible version 1.7.2, ee-bryan is Windows 8.1, ee-csg is 
 Windows Server 2012. Both have Powershell 4.

 under /etc/ansible I have created hosts as
 [windows]
 ee-bryan
 ee-csg

 and I have created /etc/ansible/group_vars/windows.yml with

 #It is suggested that these be encrypted with ansible-vault:
 # ansible-vault edit group_vars/windows.yml
 #
  ansible_ssh_user: Administrator
  ansible_ssh_pass: password
  ansible_ssh_port: 5986
  ansible_connection: winrm

 but on testing I get 

 # ansible windows -m win_ping
 ee-csg.ee.ic.ac.uk | FAILED => Traceback (most recent call last):
   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", 
 line 561, in _executor
 exec_rc = self._executor_internal(host, new_stdin)
   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", 
 line 666, in _executor_internal
 return self._executor_internal_inner(host, self.module_name, 
 self.module_args, inject, port, complex_args=complex_args)
   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", 
 line 837, in _executor_internal_inner
 conn = self.connector.connect(actual_host, actual_port, 
 actual_user, actual_pass, actual_transport, actual_private_key_file)
   File "/usr/lib/python2.7/site-packages/ansible/runner/connection.py", 
 line 34, in connect
 self.active = conn.connect()
   File 
 "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
  
 line 132, in connect
 self.protocol = self._winrm_connect()
   File 
 "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
  
 line 90, in _winrm_connect
 err_msg = str(exc.args[0])
 IndexError: tuple index out of range

 ee-bryan.ee.ic.ac.uk | FAILED => Traceback (most recent call last):
   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", 
 line 561, in _executor
 exec_rc = self._executor_internal(host, new_stdin)
   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", 
 line 666, in _executor_internal
 return self._executor_internal_inner(host, self.module_name, 
 self.module_args, inject, port, complex_args=complex_args)
   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", 
 line 837, in _executor_internal_inner
 conn = self.connector.connect(actual_host, actual_port, 
 actual_user, actual_pass, actual_transport, actual_private_key_file)
   File "/usr/lib/python2.7/site-packages/ansible/runner/connection.py", 
 line 34, in connect
 self.active = conn.connect()
   File 
 "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
  
 line 132, in connect
 self.protocol = self._winrm_connect()
   File 
 "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
  
 line 90, in _winrm_connect
 err_msg = str(exc.args[0])
 IndexError: tuple index out of range

  -- 
>>> 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 an

Re: [ansible-project] Re: Ansible Windows

2014-11-20 Thread Peter Daly-Dickson
I get exactly the same...

*☿* |staging:e38026ddcaae ✗| → ansible -i ./provisioning/hosts windows -m 
win_ping

54.67.74.52 | FAILED => Traceback (most recent call last):

  File 
"/usr/local/lib/python2.7/site-packages/ansible-1.7.2-py2.7.egg/ansible/runner/__init__.py",
 
line 561, in _executor

exec_rc = self._executor_internal(host, new_stdin)

  File 
"/usr/local/lib/python2.7/site-packages/ansible-1.7.2-py2.7.egg/ansible/runner/__init__.py",
 
line 666, 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/site-packages/ansible-1.7.2-py2.7.egg/ansible/runner/__init__.py",
 
line 837, 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/site-packages/ansible-1.7.2-py2.7.egg/ansible/runner/connection.py",
 
line 34, in connect

self.active = conn.connect()

  File 
"/usr/local/lib/python2.7/site-packages/ansible-1.7.2-py2.7.egg/ansible/runner/connection_plugins/winrm.py",
 
line 132, in connect

self.protocol = self._winrm_connect()

  File 
"/usr/local/lib/python2.7/site-packages/ansible-1.7.2-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

I installed ansible on my Macbook Pro via homebrew. What's the 
best/quickest/easiest way to get the fix for this?

Thanks.

P.

On Saturday, 25 October 2014 20:47:20 UTC+1, Chris Church wrote:
>
> That IndexError has been fixed in ansible devel.  It's not really a 
> pywinrm issue, but an ansible issue in trying to handle the HTTPError from 
> pywinrm.
>
> It happens when the HTTPError from urllib2 isn't a file-like object 
> (despite what the docs say in 
> https://docs.python.org/2/library/urllib2.html#urllib2.HTTPError).
>
>
> On Mon, Oct 20, 2014 at 4:58 PM, Michael DeHaan  > wrote:
>
>> This is probably a good error to file upstream with winrm, such that on 
>> this error it can present something better to the user.
>>
>> We could catch it, but an IndexError is the wrong sort of exception to be 
>> catching here.
>>
>>
>>
>> On Sun, Oct 19, 2014 at 2:44 PM, Trond Hindenes > > wrote:
>>
>>> Have you prepared your Windows nodes as per documentation? Basically, 
>>> yuu need to enable WinRM connections over HTTPS, and enable Baisc auth for 
>>> your WinRm endpoint. Look at the documentation, there's a script that will 
>>> do those things for you. I've uploaded a newer version of that script here: 
>>> https://gist.github.com/trondhindenes/2cd162d4b17c2c28ec40
>>>
>>> _Trond
>>>
>>>
>>> On Friday, October 17, 2014 5:02:06 PM UTC+2, Bryan Cochrane wrote:
>>>
 I am trying to setup windows remoting for ansible.

 I have Ansible version 1.7.2, ee-bryan is Windows 8.1, ee-csg is 
 Windows Server 2012. Both have Powershell 4.

 under /etc/ansible I have created hosts as
 [windows]
 ee-bryan
 ee-csg

 and I have created /etc/ansible/group_vars/windows.yml with

 #It is suggested that these be encrypted with ansible-vault:
 # ansible-vault edit group_vars/windows.yml
 #
  ansible_ssh_user: Administrator
  ansible_ssh_pass: password
  ansible_ssh_port: 5986
  ansible_connection: winrm

 but on testing I get 

 # ansible windows -m win_ping
 ee-csg.ee.ic.ac.uk | FAILED => Traceback (most recent call last):
   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", 
 line 561, in _executor
 exec_rc = self._executor_internal(host, new_stdin)
   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", 
 line 666, in _executor_internal
 return self._executor_internal_inner(host, self.module_name, 
 self.module_args, inject, port, complex_args=complex_args)
   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", 
 line 837, in _executor_internal_inner
 conn = self.connector.connect(actual_host, actual_port, 
 actual_user, actual_pass, actual_transport, actual_private_key_file)
   File "/usr/lib/python2.7/site-packages/ansible/runner/connection.py", 
 line 34, in connect
 self.active = conn.connect()
   File 
 "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
  
 line 132, in connect
 self.protocol = self._winrm_connect()
   File 
 "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
  
 line 90, in _winrm_connect
 err_msg = str(exc.args[0])
 IndexError: tuple index out of range

 ee-bryan.ee.ic.ac.uk | FAILED => Traceback (most recent call last):
   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", 
 line 561, in _executor
 exec_rc = self._executo

Re: [ansible-project] Re: Ansible Windows

2014-10-25 Thread Chris Church
That IndexError has been fixed in ansible devel.  It's not really a pywinrm
issue, but an ansible issue in trying to handle the HTTPError from pywinrm.

It happens when the HTTPError from urllib2 isn't a file-like object
(despite what the docs say in
https://docs.python.org/2/library/urllib2.html#urllib2.HTTPError).


On Mon, Oct 20, 2014 at 4:58 PM, Michael DeHaan  wrote:

> This is probably a good error to file upstream with winrm, such that on
> this error it can present something better to the user.
>
> We could catch it, but an IndexError is the wrong sort of exception to be
> catching here.
>
>
>
> On Sun, Oct 19, 2014 at 2:44 PM, Trond Hindenes 
> wrote:
>
>> Have you prepared your Windows nodes as per documentation? Basically, yuu
>> need to enable WinRM connections over HTTPS, and enable Baisc auth for your
>> WinRm endpoint. Look at the documentation, there's a script that will do
>> those things for you. I've uploaded a newer version of that script here:
>> https://gist.github.com/trondhindenes/2cd162d4b17c2c28ec40
>>
>> _Trond
>>
>>
>> On Friday, October 17, 2014 5:02:06 PM UTC+2, Bryan Cochrane wrote:
>>
>>> I am trying to setup windows remoting for ansible.
>>>
>>> I have Ansible version 1.7.2, ee-bryan is Windows 8.1, ee-csg is Windows
>>> Server 2012. Both have Powershell 4.
>>>
>>> under /etc/ansible I have created hosts as
>>> [windows]
>>> ee-bryan
>>> ee-csg
>>>
>>> and I have created /etc/ansible/group_vars/windows.yml with
>>>
>>> #It is suggested that these be encrypted with ansible-vault:
>>> # ansible-vault edit group_vars/windows.yml
>>> #
>>>  ansible_ssh_user: Administrator
>>>  ansible_ssh_pass: password
>>>  ansible_ssh_port: 5986
>>>  ansible_connection: winrm
>>>
>>> but on testing I get
>>>
>>> # ansible windows -m win_ping
>>> ee-csg.ee.ic.ac.uk | FAILED => Traceback (most recent call last):
>>>   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py",
>>> line 561, in _executor
>>> exec_rc = self._executor_internal(host, new_stdin)
>>>   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py",
>>> line 666, in _executor_internal
>>> return self._executor_internal_inner(host, self.module_name,
>>> self.module_args, inject, port, complex_args=complex_args)
>>>   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py",
>>> line 837, in _executor_internal_inner
>>> conn = self.connector.connect(actual_host, actual_port,
>>> actual_user, actual_pass, actual_transport, actual_private_key_file)
>>>   File "/usr/lib/python2.7/site-packages/ansible/runner/connection.py",
>>> line 34, in connect
>>> self.active = conn.connect()
>>>   File 
>>> "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
>>> line 132, in connect
>>> self.protocol = self._winrm_connect()
>>>   File 
>>> "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
>>> line 90, in _winrm_connect
>>> err_msg = str(exc.args[0])
>>> IndexError: tuple index out of range
>>>
>>> ee-bryan.ee.ic.ac.uk | FAILED => Traceback (most recent call last):
>>>   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py",
>>> line 561, in _executor
>>> exec_rc = self._executor_internal(host, new_stdin)
>>>   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py",
>>> line 666, in _executor_internal
>>> return self._executor_internal_inner(host, self.module_name,
>>> self.module_args, inject, port, complex_args=complex_args)
>>>   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py",
>>> line 837, in _executor_internal_inner
>>> conn = self.connector.connect(actual_host, actual_port,
>>> actual_user, actual_pass, actual_transport, actual_private_key_file)
>>>   File "/usr/lib/python2.7/site-packages/ansible/runner/connection.py",
>>> line 34, in connect
>>> self.active = conn.connect()
>>>   File 
>>> "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
>>> line 132, in connect
>>> self.protocol = self._winrm_connect()
>>>   File 
>>> "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
>>> line 90, in _winrm_connect
>>> err_msg = str(exc.args[0])
>>> IndexError: tuple index out of range
>>>
>>>  --
>> 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 ansible-project+unsubscr...@googlegroups.com.
>> To post to this group, send email to ansible-project@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/5a2d00b4-3009-4912-abe9-28c9764dc9f8%40googlegroups.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you

Re: [ansible-project] Re: Ansible Windows

2014-10-20 Thread Michael DeHaan
This is probably a good error to file upstream with winrm, such that on
this error it can present something better to the user.

We could catch it, but an IndexError is the wrong sort of exception to be
catching here.



On Sun, Oct 19, 2014 at 2:44 PM, Trond Hindenes  wrote:

> Have you prepared your Windows nodes as per documentation? Basically, yuu
> need to enable WinRM connections over HTTPS, and enable Baisc auth for your
> WinRm endpoint. Look at the documentation, there's a script that will do
> those things for you. I've uploaded a newer version of that script here:
> https://gist.github.com/trondhindenes/2cd162d4b17c2c28ec40
>
> _Trond
>
>
> On Friday, October 17, 2014 5:02:06 PM UTC+2, Bryan Cochrane wrote:
>
>> I am trying to setup windows remoting for ansible.
>>
>> I have Ansible version 1.7.2, ee-bryan is Windows 8.1, ee-csg is Windows
>> Server 2012. Both have Powershell 4.
>>
>> under /etc/ansible I have created hosts as
>> [windows]
>> ee-bryan
>> ee-csg
>>
>> and I have created /etc/ansible/group_vars/windows.yml with
>>
>> #It is suggested that these be encrypted with ansible-vault:
>> # ansible-vault edit group_vars/windows.yml
>> #
>>  ansible_ssh_user: Administrator
>>  ansible_ssh_pass: password
>>  ansible_ssh_port: 5986
>>  ansible_connection: winrm
>>
>> but on testing I get
>>
>> # ansible windows -m win_ping
>> ee-csg.ee.ic.ac.uk | FAILED => Traceback (most recent call last):
>>   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py",
>> line 561, in _executor
>> exec_rc = self._executor_internal(host, new_stdin)
>>   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py",
>> line 666, in _executor_internal
>> return self._executor_internal_inner(host, self.module_name,
>> self.module_args, inject, port, complex_args=complex_args)
>>   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py",
>> line 837, in _executor_internal_inner
>> conn = self.connector.connect(actual_host, actual_port, actual_user,
>> actual_pass, actual_transport, actual_private_key_file)
>>   File "/usr/lib/python2.7/site-packages/ansible/runner/connection.py",
>> line 34, in connect
>> self.active = conn.connect()
>>   File 
>> "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
>> line 132, in connect
>> self.protocol = self._winrm_connect()
>>   File 
>> "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
>> line 90, in _winrm_connect
>> err_msg = str(exc.args[0])
>> IndexError: tuple index out of range
>>
>> ee-bryan.ee.ic.ac.uk | FAILED => Traceback (most recent call last):
>>   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py",
>> line 561, in _executor
>> exec_rc = self._executor_internal(host, new_stdin)
>>   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py",
>> line 666, in _executor_internal
>> return self._executor_internal_inner(host, self.module_name,
>> self.module_args, inject, port, complex_args=complex_args)
>>   File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py",
>> line 837, in _executor_internal_inner
>> conn = self.connector.connect(actual_host, actual_port, actual_user,
>> actual_pass, actual_transport, actual_private_key_file)
>>   File "/usr/lib/python2.7/site-packages/ansible/runner/connection.py",
>> line 34, in connect
>> self.active = conn.connect()
>>   File 
>> "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
>> line 132, in connect
>> self.protocol = self._winrm_connect()
>>   File 
>> "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
>> line 90, in _winrm_connect
>> err_msg = str(exc.args[0])
>> IndexError: tuple index out of range
>>
>>  --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/5a2d00b4-3009-4912-abe9-28c9764dc9f8%40googlegroups.com
> 
> .
>
> 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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyryKWdSaka0-uVJzLp9pT%2BgV3dJTQHUSZnnAUCEmFCrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.