Re: [ansible-project] Fetch equivalent command in windows?

2016-04-13 Thread Chris Church
The fetch module also works on Windows (see
https://github.com/ansible/ansible/blob/devel/test/integration/roles/test_win_fetch/tasks/main.yml
for some example usage).

On Wed, Apr 13, 2016 at 12:42 AM, Deepa Yr  wrote:

> Hi
>
>  I want to copy a file from windows client to Ansible controller
> machine (linux). I see fetch command which does that .What is the
> equivalent one for windows. I could not find it in the documentation
>
> Thanks
>
> --
> 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/677dbda3-28ce-45ae-9deb-23d010454a54%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/CAH%2BKTJ7sJWfMjaqM14VSYk3ZBbcUbsQPg8B_rWr8uNkwYJsKtQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Ansible createsuperuser with django_manage module.

2015-12-07 Thread Chris Church
Could you paste the task you're using that gives this error?

On Fri, Dec 4, 2015 at 1:09 AM,  wrote:

> Thanks Chris.
>
> Instead of the solution you have suggested, I'm tried to create a custom
> django manage command. But when i invoked this from ansible through
> django_manage, its throws an error like the one below.
>
> fatal: [djangoskeleton-local.com] => failed to parse:
> SUDO-SUCCESS-wzpnssbmxbwqvxmfgljczjecbynjytor
> Traceback (most recent call last):
>   File
> "/home/vagrant/.ansible/tmp/ansible-tmp-1449209268.07-207237531077051/django_manage",
> line 1627, in 
> main()
>   File
> "/home/vagrant/.ansible/tmp/ansible-tmp-1449209268.07-207237531077051/django_manage",
> line 228, in main
> if value and param not in command_allowed_param_map[command]:
> KeyError: 'change_django_admin_password --username=admin
> --password=tarams123'
>
>
> FATAL: all hosts have already failed -- aborting
>
> This command works fine when I tried from python manage.py shell.
>
> Could you please suggest.
>
> On Thursday, December 3, 2015 at 10:35:52 AM UTC+5:30,
> anoop@tarams.com wrote:
>>
>> Hi,
>>
>> I'm creating a super user for my django application through ansible.
>> Script is below.
>>
>> django_manage: command="createsuperuser --noinput --username=admin
>> --email=anoop.kol...@tarams.com" app_path={{ django_dir }}
>> settings={{settings_path}}
>>
>> Its creating the super user with some random password. Please let me know
>> the following at the earliest.
>>
>>
>> 1) Is it possible to set password with the command?
>> 2) Whats the default password its setting when executing that command?
>>
>>  =
>> DISCLAIMER: The information in this message is confidential and may be
>> legally privileged. It is intended solely for the addressee. Access to this
>> message by anyone else is unauthorized. If you are not the intended
>> recipient, any disclosure, copying, or distribution of the message, or any
>> action or omission taken by you in reliance on it, is prohibited and may be
>> unlawful. Please immediately contact the sender if you have received this
>> message in error. Further, this e-mail may contain viruses and all
>> reasonable precaution to minimize the risk arising there from is taken by
>> Tarams. Tarams is not liable for any damage sustained by you as a result of
>> any virus in this e-mail. All applicable virus checks should be carried out
>> by you before opening this e-mail or any attachment thereto.
>> Thank you - Tarams Software Technologies Pvt.Ltd.
>> =
>>
>
>  =
> DISCLAIMER: The information in this message is confidential and may be
> legally privileged. It is intended solely for the addressee. Access to this
> message by anyone else is unauthorized. If you are not the intended
> recipient, any disclosure, copying, or distribution of the message, or any
> action or omission taken by you in reliance on it, is prohibited and may be
> unlawful. Please immediately contact the sender if you have received this
> message in error. Further, this e-mail may contain viruses and all
> reasonable precaution to minimize the risk arising there from is taken by
> Tarams. Tarams is not liable for any damage sustained by you as a result of
> any virus in this e-mail. All applicable virus checks should be carried out
> by you before opening this e-mail or any attachment thereto.
> Thank you - Tarams Software Technologies Pvt.Ltd.
> =
>
> --
> 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/dc941069-a059-408e-a3ca-47c78730d8da%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/CAH%2BKTJ4zAK0T_95sFBmP5Cd%3DNYUuiVEom_cy9UA1mSwbn%3Dyhww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible createsuperuser with django_manage module.

2015-12-03 Thread Chris Church
This is really more of a Django issue than an Ansible one.  It's most
likely creating the user with an unusable password ("*").

There isn't a way with the built-in createsuperuser command to set a
password.  You can find one approach that addresses this problem at
http://source.mihelac.org/2009/10/23/django-avoiding-typing-password-for-superuser/
.


On Thu, Dec 3, 2015 at 12:05 AM,  wrote:

> Hi,
>
> I'm creating a super user for my django application through ansible.
> Script is below.
>
> django_manage: command="createsuperuser --noinput --username=admin --email=
> anoop.kol...@tarams.com" app_path={{ django_dir }}
> settings={{settings_path}}
>
> Its creating the super user with some random password. Please let me know
> the following at the earliest.
>
>
> 1) Is it possible to set password with the command?
> 2) Whats the default password its setting when executing that command?
>
>  =
> DISCLAIMER: The information in this message is confidential and may be
> legally privileged. It is intended solely for the addressee. Access to this
> message by anyone else is unauthorized. If you are not the intended
> recipient, any disclosure, copying, or distribution of the message, or any
> action or omission taken by you in reliance on it, is prohibited and may be
> unlawful. Please immediately contact the sender if you have received this
> message in error. Further, this e-mail may contain viruses and all
> reasonable precaution to minimize the risk arising there from is taken by
> Tarams. Tarams is not liable for any damage sustained by you as a result of
> any virus in this e-mail. All applicable virus checks should be carried out
> by you before opening this e-mail or any attachment thereto.
> Thank you - Tarams Software Technologies Pvt.Ltd.
> =
>
> --
> 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/bcbd0d27-f686-4ff2-a88d-5c1cbd8aaef6%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/CAH%2BKTJ7fAnba7TD%2B_aCHw49gpVxvUG_x2eUrRy6xRgwY6ECSfA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Doing ec2_win_password in Ansible 1.9.4 ?

2015-11-24 Thread Chris Church
You can include a copy of the module from 2.x in a library directory
alongside your playbook or in a role (e.g.
https://github.com/cchurch/ansible-role-win-ec2/tree/master/library -- I
renamed the module so it's clear which one I'm using when running with
either 1.9.x or 2.x).

On Tue, Nov 24, 2015 at 12:30 PM, Slim Slam  wrote:

> Is there a way to get the Windows password for an EC2 Windows Server in
> Ansible 1.9.4 ?
> It appears that ec2_win_password only works in Ansible 2.x
>
> J
>
> --
> 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/12ea3f5f-08d4-4971-9922-c62217c3846c%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/CAH%2BKTJ5NO%2Bu_JSWOrMGz2APkz7YWd75tvb5axFo9zA1KS_rtPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Run .exe on windows command prompt

2015-09-28 Thread Chris Church
It appears as though the backslashes are escaping the character that
follows (which doesn't quite make sense since your example uses a
single-quoted string).   What version of ansible are you using?

You could try:raw: "D:\\builds\\router\\bin\\wrapper.exe"


On Mon, Sep 28, 2015 at 4:27 AM, Jugal Porwal  wrote:

> Hi,
>
> I want to run a .exe on windows command prompt from my centos control
> node. The command is as follows :
>
> wrapper.exe  -t wrapper.conf
>
> Initially i tried to atleast run the .exe without any args using my
> following playbook :
>
> ---
> - hosts: windows
>   tasks:
> - name: Register as a service
>   raw: 'D:\builds\router\bin\wrapper.exe'
>
>
>
> But i got the following error:
>
> fatal: [192.168.199.94]: FAILED! => {"changed": false, "failed": true,
> "rc": 1, "stderr": "#< CLIXML\r\n http://schemas.microsoft.com/powershell/2004/04\";> S=\"Error\">D:_x0008_uilds : The term 'D:_x0008_uilds' is not recognized as
> the name of a cmdlet, _x000D__x000A_function, script
> file, or operable program. Check the spelling of the name, or
> _x000D__x000A_if a path was included, verify that the
> path is correct and try again._x000D__x000A_At line:1
> char:1_x000D__x000A_+ D:_x0008_uilds_x000D__x000A_ S=\"Error\">+ _x000D__x000A_+
> CategoryInfo  : ObjectNotFound: (D:_x0008_uilds:String) [],
> CommandNot _x000D__x000A_
> FoundException_x000D__x000A_+
> FullyQualifiedErrorId : CommandNotFoundException_x000D__x000A_ S=\"Error\"> _x000D__x000A_outer_x0008_in\\wrapper.exe
> : The module 'outer_x0008_in' could not be loaded. For more
> _x000D__x000A_information, run 'Import-Module
> outer_x0008_in'._x000D__x000A_At line:2
> char:1_x000D__x000A_+ 
> outer_x0008_in\\wrapper.exe_x000D__x000A_ S=\"Error\">+ _x000D__x000A_+
> CategoryInfo  : ObjectNotFound: (outer_x0008_in\\wrapper.exe:String)
> [] _x000D__x000A_   , 
> CommandNotFoundException_x000D__x000A_ S=\"Error\">+ FullyQualifiedErrorId : 
> CouldNotAutoLoadModule_x000D__x000A_ S=\"Error\"> _x000D__x000A_", "stdout": "", "stdout_lines": []}
>
>
> Is it achievable what i'm trying to do?
>
> --
> 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/f7d197e0-fb20-4cbd-b4da-bae2b726bc05%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/CAH%2BKTJ5470qWS0m4nvQK25k_12JeaQ0frN7aMZ6_1r9VvMikBQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Can't use local_action in Windows playbook in devel?

2015-09-17 Thread Chris Church
"local_action" and "delegate_to: localhost" should both be working again
with Windows hosts.

There may still be another issue delegating to another host, which is being
tracked by https://github.com/ansible/ansible/issues/12370.

On Sat, Sep 12, 2015 at 6:18 PM, Frank Perks  wrote:

> delegate_to: localhost seems to work okay for most cases when working in a
> playbook. Unfortunately the solution doesn't seem to work when doing it
> inside a role:
>
> - wait_for host={{ ansible_ssh_host }} port={{ ansible_ssh_port }} delay=
> 30 timeout=300
>   delegate_to: localhost
>
> I get: "ERROR! The module wait_for was not found in configured module
> paths" Is there any other sort of workaround that exists (i cannot live
> without blocks anymore).
>
> On Thursday, September 10, 2015 at 5:35:49 AM UTC-4, J Hawkesworth wrote:
>>
>> Looks like you have hit https://github.com/ansible/ansible/issues/12053
>>
>> changing over to
>>delegate_to: localhost
>>
>> will likely work around the problem for now, until the above can be fixed.
>>
>> Jon
>>
>> On Thursday, September 10, 2015 at 9:09:20 AM UTC+1, Trond Hindenes wrote:
>>>
>>> That is very strange. I spent a lot of time making sure it would work in
>>> both 1.9 and 2.0. Will test and report back.
>>>
>>> On Wednesday, September 9, 2015 at 5:46:39 PM UTC+2, Frank Perks wrote:

 Just to add something else, in 1.9.4 both Trond and my stuff works
 fine.

 On Wednesday, September 9, 2015 at 10:44:35 AM UTC-4, Frank Perks wrote:
>
> Hi Trond,
>
> I tried your module, and it fails with the same issue as above.
>
> fatal: [52.8.31.205]: FAILED! => {"failed": true, "msg": "ERROR! The
> module stat was not found in configured module paths"}
>
> I have found a really ugly way to get around it, and that is by simply
> defining another play with the wait_for winrm. Then starting another play
> for the remaining windows tasks.
>
>
> On Wednesday, September 9, 2015 at 10:29:05 AM UTC-4, Trond Hindenes
> wrote:
>>
>> Frank, I actually put a lot of work into the trondhindenes.win_reboot
>> role you can find on Galaxy. WIth it you can force reboots, run reboots 
>> for
>> nodes needing a reboot or whatever, and it will correctly run cooldown
>> scripts and loop until it has a stable winrm service running before it 
>> will
>> allow continuation. Maybe see if that solves this exact case for you?
>>
>> as for connection: local, I've had far better results with
>> delegate_to: localhost on the current devel branch.
>>
>> On Wednesday, September 9, 2015 at 3:38:03 PM UTC+2, Frank Perks
>> wrote:
>>>
>>> This is running latest version of devel (i updated this morning).
>>>
>>> delegate_to / connnection: local does not seem to work.
>>>
>>> On Wednesday, September 9, 2015 at 8:45:47 AM UTC-4, Brian Coca
>>> wrote:

 What version of ansible? have you tried with connection: local or
 delegate_to: localhost:?

  It seems we lookup the module before making the connection local,
 in
 which case it is still looking for .ps1 files.


 --
 Brian Coca

>>> --
> 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/1f2359f7-1c80-4419-94b9-8e8dd656101f%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/CAH%2BKTJ7jbX3ffh5PKoNGCj0shdNuvFpM25ROQf1VFa%3Dj0FmJog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: questions regarding ansible raw module on windows

2015-09-16 Thread Chris Church
If using an Ansible checkout from the devel branch, the raw module should
just work for PowerShell snippets.  See examples in the integration tests (
https://github.com/ansible/ansible/blob/devel/test/integration/roles/test_win_raw/tasks/main.yml#L75
).

In 1.9.x, you may have to prefix your command with "PowerShell -Command"
for it to work.


On Wed, Sep 16, 2015 at 12:11 AM, breatheoften  wrote:

> Nevermind -- not sure where I remember seeing reference to running
> powershell snippets via raw: -- but I certainly can't find it again ...
>
> It sure would be a nice feature ... -- I've found that even on the unix
> side, it is frequently a 'very-fast-value-add' proposition to quickly
> rewrite old shell scripts into a work-alike sequence of equivalent ansible
> shell tasks (interspersed with other ansible modules where appropriate).
> This often yields quick and fast readability/reliability wins and much of
> the time yields instant improvements in the quality of the execution
> environment for that particular piece of automation ...  Was hoping to do
> the same thing with some powershell scripts but the raw: execution module
> doesn't support powershell snippets.
>
> --
> 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/5f71cc72-9fbc-4dd5-b8ea-beb2d5e1fc48%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/CAH%2BKTJ51Bjc-iUvz0JEuNp2Pv3UJn2DhdBBe3trnajOA1GiSbQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Windows - multiple paths with spaces

2015-09-11 Thread Chris Church
Which version of Ansible are you using?  There are some fixes in 2.0 that
addressed argument quoting and issues with spaces in paths.  Due to some
other recent issues, I might suggest trying 2.0.0-0.2.alpha2 instead of
latest devel.


On Fri, Sep 11, 2015 at 7:19 AM, Matt Gagliardi 
wrote:

> Good morning all!  I'm fairly new to Ansible but I've been banging away at
> it for several weeks and feel like I'm getting a decent understanding of
> it.  However I've run into an issue I'm struggling with.  I have a playbook
> for Windows Server 2012 R2...95% of it works great.  But I'm stuck on
> literally the last item I need to add.  I'm trying to use the raw module to
> call and .exe and pass in some arguments.  The path to the .exe has some
> spaces, as does on of the arguments.  This is a rough approximation of what
> I'm trying to do looks like:
>
> - name: Register database
>   raw: '"C:\\Program Files\\Company
> Name\\Dir3\\dir4\name.name.name.name.exe" --setupServer
> --product=ProductName --dbDir="C:\\Program Files\\Company Name\\Dir3\dir4"
> --server=host\\Instance --user=username --password=*'
>
> FWIW those are single-quotes at the beginning and the end. I had issues
> getting the quotes "right" (still not 100% convinced they're healthy) but
> at this point the playbook at least runs (no trip-ups in the YAML parser)
> but I'm getting this:
>
> "C:\Program is not recognized as in internal or external command..."
>
> If I pull out the second bit with the path (the one for --dbDir=) I can
> get the .exe to run but I'm missing a required variable so it tanks.  I
> guess I'm screwing up something with the quoting but I can't figure out
> what the heck it is.  Could anyone give me a pointer or two here?
>
> Thanks!
> Matt
>
> --
> 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/29e83b57-3f45-4d41-a35d-155cecd79f03%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/CAH%2BKTJ4tF1%3D3_3_4Td_ik4zxiwAJwF9WxjojKEDXi6dBFogWqg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] module win_user

2015-09-09 Thread Chris Church
I can't seem to reproduce with either 1.9.3 or devel against a Windows 2008
Server instance.  Adding a user to the Users or Administrators group is
enough for it to show up in my case.

On Tue, Sep 8, 2015 at 10:26 AM, Matt Martz  wrote:

> IIRC, this has something to do with not being placed in any groups by
> default, specifically the one needed to show up on the login screen.  I
> don't remember what it is, but logins should still be allowed.
>
>
> On Tuesday, September 8, 2015, Trond Hindenes  wrote:
>
>> I don't understand the question. Can you log on with the created user by
>> typing in the username?
>>
>> On Tuesday, September 8, 2015 at 3:34:19 PM UTC+2, e.bar...@404-group.com
>> wrote:
>>>
>>> Hi.
>>> We have a vm ubuntu 14.04 LTS with ansible 1.9.3 and python 2.7.
>>> I want to create users on a machine with windows.
>>> Using module winrm on windows and win_user module for creating profile.
>>> (Testing in o.s.: windows 7, windows 8/8.1)
>>>
>>> My playbook:
>>> ---
>>> - name: Add a user
>>>   hosts: all
>>>   tasks:
>>>- name: Add user in system
>>> win_user:
>>> name: test
>>> password: "password"
>>> groups: ["users"]
>>> state: present
>>>
>>> run playbook:
>>> ansible-playbook - -i hosts playbooks/users.yml
>>>
>>> result:
>>> changed: [192.168.1.171] => {"account_disabled": false,
>>> "account_locked": false, "changed": true, "description": "", "fullname":
>>> "test", "groups": [{"name": "users", "path":
>>> "WinNT://WORKGROUP/mycomp/users"}], "name": "test", "password_expired":
>>> false, "password_never_expires": true, "path":
>>> "WinNT://WORKGROUP/mycomp/test", "sid":
>>> "S-1-5-21-2925825274-3949947971-3441621627-1016", "state": "present",
>>> "user_cannot_change_password": false}
>>> ```
>>> In windows system user is created, and I see this in: managing computer
>>> >  users. But in logon window user does not appear.
>>> Why ? Help me please
>>>
>> --
>> 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/2f269954-843a-4c3b-973e-fbdb80a56b9f%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Matt Martz
> @sivel
> sivel.net
>
> --
> 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/CAD8N0v_K%2BZ-ZKzAvw9Q-uG-C2hyXE4hVjpcV6aigg6C9x5us1g%40mail.gmail.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/CAH%2BKTJ4A1Gf_quj3hP5VJaHQB2cDCvP-VLesJuW4Z6dUKFto8g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Confused about windows passwords and working with ec2?

2015-09-09 Thread Chris Church
You may also want to check out my win-ec2 role as an example of fetching
the passwords, adding them to inventory and generating a static inventory
file:

https://github.com/cchurch/ansible-role-win-ec2/blob/master/tasks/main.yml#L79

(I use a renamed copy of the ec2_win_password module so the role will work
with 1.9.x)


On Wed, Sep 9, 2015 at 10:26 AM, Trond Hindenes  wrote:

> I've been bitten by "Connection: local" aswell. Could you try delegate_to:
> localhost instead and see if that works better for you?
>
> On Wednesday, September 9, 2015 at 3:58:52 PM UTC+2, Frank Perks wrote:
>>
>> This does not actually work, i get
>>
>> FAILED! => {"failed": true, "msg": "ERROR! The module ec2_win_password
>> was not found in configured module paths"}
>>
>> I am assuming this is related to this issue:
>> https://groups.google.com/forum/#!topic/ansible-project/PqwMiIHV0js
>>
>> On Wednesday, September 9, 2015 at 7:30:25 AM UTC-4, Frank Perks wrote:
>>>
>>> I didn't realize you can specify the ansible connection on a per task
>>> level!
>>>
>>> That completely changes stuff!
>>>
>>> I will give this a shot!
>>>
>>> On Tuesday, September 8, 2015 at 4:51:48 PM UTC-4, Brian Coca wrote:

 have you tried this?

 - hosts: windows
   gather_facts: false
   tasks:

 - ec2_win_password: 
   connection: local

 - set_fact: ansible_ssh_host="{{ ec2_win_password.whatver}}"

 - do_other_stuff
 --
 Brian Coca

>>> --
> 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/a07b05d3-d297-4451-b207-3f7034dfb111%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/CAH%2BKTJ5vnFJt%2ByNa9ekEq59nFNyY%3DYdb3cnVwC7EUHW8vA4JEg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] is S3 module works on windows servers?

2015-08-11 Thread Chris Church
Hi Igal,

Only the win_* modules written in PowerShell are supported on Windows at
this time.

You may want to take a look at https://aws.amazon.com/powershell/ -- you
can run any PowerShell script via the script module or simple commands via
the raw module.


On Tue, Aug 11, 2015 at 4:52 AM, Igal Dahan  wrote:

> Hi
>
> Is S3 module can work on Windows ? means can i get file from S3 into
> windows ?
>
> Igal
>
> --
> 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/156cb64a-7ec4-44af-9d29-799d0a7a418e%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/CAH%2BKTJ5XKrucBjB%2BDnNJYBSt3VUACbdb_NgTvCXujZkFYJS1cA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Windows integration

2015-08-08 Thread Chris Church
Try callback_plugins (with an underscore) instead of callback-plugins.


On Sat, Aug 8, 2015 at 3:00 PM, stephane jean  wrote:

> Yes i am running python 2.7.9+ , i did create a folder callback_plugin
> with fix.ssl in my playbooks directory but i have the same error:
>
>
>
> 3[root@Debian]:ansible-playbook /etc/ansible/playbooks/run-powershell.yml
>
> PLAY [Run powershell script]
> **
>
> TASK: [Run powershell script]
> *
> fatal: [192.168.0.37] => 500 WinRMTransport. [SSL:
> CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
>
> FATAL: all hosts have already failed -- aborting
>
> PLAY RECAP
> 
>to retry, use: --limit @/root/run-powershell.retry
>
> 192.168.0.37   : ok=0changed=0unreachable=1
> failed=0
>
>
>
> my directory:
>
> /etc/ansible/
>
> ├── ansible.cfg
> ├── group_vars
> │   └── windows.yml
> ├── handlers
> │   └── httpd.yml
> ├── hosts
> ├── info.txt
> ├── playbooks
> │   ├── callback-plugins
> │   │   └── fix-ssl.py
> │   ├── examples
> │   ├── run-bash.yml
> │   └── run-powershell.yml
> ├── roles
> └── test.py
>
> i should see a fix-ssl.pyc in the callbacks-pluins directory if it's load ?
>
> I did not change anything /usr/local/lib/python2.7/dist-packages/ansible.
>
> --
> 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/af94393c-a645-4979-af62-c2d5bda69259%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/CAH%2BKTJ4d1wJ9bi-XtQKhCFwXmtUsmw3fyQWDETZ3MW8FCkq1qA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Windows integration

2015-08-07 Thread Chris Church
It looks like you're running into this issue:
https://github.com/ansible/ansible/issues/10294

I'm guessing you are running Python 2.7.9+.  The current workaround is
using a callback plugin to disable SSL verification; we'll hopefully have a
better fix by v2.

On Fri, Aug 7, 2015 at 8:31 AM, stephane jean  wrote:

> In my company i have a set of CentOS, MAC and Windows machines, i want to
> use Ansible mainly to deploy packages and scripts (bash, powershell).
> I've been trying to make it work for my windows machines, i have used the
> powershell scripts from ansible.com to enable winrm.
>
> But when i test the connection to my windows host i get this error:
>
> TASK: [Run powershell script]
> *
> fatal: [192.168.0.37] => 500 WinRMTransport. [SSL:
> CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
> FATAL: all hosts have already failed -- aborting
>
> Do you know how to solve this ?
>
> I have installed ansible with pip on a debian machine.
> i had to create the files in /etc/ansible
> maybe i've  forgot something ?
>
> tree /etc/ansible/
> ├── ansible.cfg
> ├── group_vars
> │   └── windows.yml
> ├── handlers
> │   └── httpd.yml
> ├── hosts
> ├── playbooks
> │   ├── examples
> │   ├── run-bash.yml
> │   └── run-powershell.yml
> ├── roles
>
>
> Sorry for my bad english i'm french
>
> --
> 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/ff2d5833-f1f0-44a8-bd17-bf254ecbaa31%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/CAH%2BKTJ6D9PgTAEAVfuKM8ZUz26kOjQcZU%3DUpeXkDomkxwYrPpA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] AWS Rate exceeded (Throttling), sleep or pause in loop

2015-08-05 Thread Chris Church
I'd run into a similar issue using the rax_dns and rax_dns_record modules,
so I created a simple callback plugin to sleep after each task only when
using the role that ran those modules:
https://gist.github.com/cchurch/c2694a1de478ec417ee8


On Wed, Aug 5, 2015 at 4:35 AM, Dainiax  wrote:

> Hello,
>
> Ansible 1.9.2
> Im working with Ansible AWS modules. I wanted to create 5 ELB for testing
> surpose.
> Script:
> ...
> - name: Create ELBs
>   connection: local
>   ec2_elb_lb:
> aws_access_key: "{{ AWS_ACCESS_KEY_ID }}"
> aws_secret_key: "{{ AWS_SECRET_ACCESS_KEY }}"
> name: "{{ item.name }}{{ item.elb_id }}"
> state: present
> connection_draining_timeout: 60
> cross_az_load_balancing: true
> region: eu-west-1
> zones:
>   - eu-west-1a
>   - eu-west-1b
>   - eu-west-1c
> listeners:
>   - protocol: http
> load_balancer_port: 80
> instance_port: 80
> health_check:
> ping_protocol: tcp
> ping_port: 22
> response_timeout: 5 # seconds
> interval: 30 # seconds
> unhealthy_threshold: 2
> healthy_threshold: 5
>   with_items:
> - { name: 'TEST-ELB-', elb_id: "01" }
> - { name: 'TEST-ELB-', elb_id: "02" }
> - { name: 'TEST-ELB-', elb_id: "03" }
> - { name: 'TEST-ELB-', elb_id: "04" }
> - { name: 'TEST-ELB-', elb_id: "05" }
> ...
>
> But it failed with errors
> ...
> 
> Sender
> Throttling
> Rate exceeded
>   
> ...
> So is it possible to sleep/pause between iterations of 'with_items' list
> (as I understand AWS complains about requests coming too fast)?
> Do you have any other solutions for these types of scripts (cause I also
> get the same errors for attaching instance to multiple ELBs)?
>
> Thank you
>
> --
> 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/8d7409fc-d5d8-4b74-ae9c-004bac8f7dbb%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/CAH%2BKTJ7W71wTuc1t8vu5Ndd%2BYUr4QpX2u7dm9DgzNtWW4HtMYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] connect ansible with Rackspace cloud

2015-07-21 Thread Chris Church
What's the other error you see?  Have you installed pyrax using pip?

On Tue, Jul 21, 2015 at 11:22 AM, Mohamed Megdadi 
wrote:

> Hello,
>
> I am  new at ansible, i am trying to run a playbook to connect ansible
> with Rackspace cloud, each time we run it we have this error: "pyrax is
> required for this module" but when we try to import Pyrax via python, we
> get another error.
>
> i am using Ubuntu 14.04 OS.
>
>
> Thanks,
> Mohamed
>
> --
> 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/8b8a9962-1bcd-43c2-94ce-82ca7679d9af%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/CAH%2BKTJ7kFwoOTb%3DYn-mdKKpo%2BvPxDowcDqxW1mT%2Bz8oFZ%2BmtYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to deploy a particular git branch and commit id using ansible git module?

2015-07-21 Thread Chris Church
Use the version option to specify a particular branch, tag or commit id.
See http://docs.ansible.com/ansible/git_module.html

- git: repo={{project_repo}} dest={{project_doc_root}}
version={{project_version}} accept_hostkeys=yes




On Sun, Jul 19, 2015 at 11:48 PM, Adithya Khamithkar 
wrote:

> Hi,
> I would need some help in how to deploy a particular git branch and commit
> id using ansible git module,
>
> - name: Deploy
>   git: repo={{project_repo}} dest={{project_doc_root}} accept_hostkey=yes
>
> This is the command i am using which i would like to extend.
>
> Thanks,
>
>  --
> 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/198918cd-154b-4f5e-94bb-d94a64f829fb%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/CAH%2BKTJ7cA_zKuVPweecDAoiOcN_X8n%3Dq_pY6neDBQhOB0qY91g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] registeration of DNS records in Active Directory DNS

2015-04-20 Thread Chris Church
I don't know of an Ansible module to handle this kind of update.  Are your
OpenStack instances running Windows or Linux?  And are you using Ansible
for any configuration of your AD server?

The following thread may offer some suggestions for ways to update DNS from
Linux instances:

http://serverfault.com/questions/276901/register-a-records-for-my-linux-box-on-my-windows-2008-dns-dhcp-server


If you're using Ansible to manage your AD server, you may be able to start
with some of these PowerShell examples to manage DNS:

http://blogs.technet.com/b/heyscriptingguy/archive/2010/09/13/manage-dns-in-a-windows-environment-by-using-powershell.aspx
https://technet.microsoft.com/en-us/library/jj649850.aspx


Hope that helps!


On Mon, Apr 20, 2015 at 10:52 AM, John Test  wrote:

> Hello,
> I was wondering if there is an existing Ansible module to register records
> in Active Directory DNS.
> My workflow attempt is to create Openstack instances and register their
> DNS records in AD.
>
> Thank you
>
> --
> 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/b5d8de56-f238-4131-b35a-487099a62ac2%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/CAH%2BKTJ5EbO9yUWPOHxfBi-xap6PYpRR_BLf%3Dy-6SCp6qEkQ4FA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Changing existing variable

2015-04-18 Thread Chris Church
Have you tried set_fact (http://docs.ansible.com/set_fact_module.html)?

On Sat, Apr 18, 2015 at 2:34 PM, Adam Hamsik  wrote:

> Hi,
>
> Is it possible to create custom module or filter which will edit variable
> from variable cache ?
>
> --
> 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/7d4b38d3-7884-49be-bf41-2ef04d69d19d%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/CAH%2BKTJ5ZT9hTEdJ-caQ%3DPg0FR3HYnP0smBKB3B469Ka%3DC11yDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] access local file from ansible custom module

2015-04-18 Thread Chris Church
If you need to use a local file from your module, you may need to create an
action plugin along with your remote module.  The patch "module", for
example, uses an action plugin to read the source file (when
remote_src=False) and copy it to the remote system before running the patch
module remotely:

https://github.com/ansible/ansible/blob/devel/lib/ansible/runner/action_plugins/patch.py
https://github.com/ansible/ansible-modules-extras/blob/devel/files/patch.py


If you're thinking this custom module may be published or contributed back
to Ansible at some point, note that the action plugin API is changing for
v2:

https://github.com/ansible/ansible/blob/devel/v2/ansible/plugins/action/patch.py



On Fri, Apr 17, 2015 at 7:39 PM, jack  wrote:

> Hi,
>
> We are trying to deploying some custom modules which have a requirement to
> access some local files? Is that possible?
>
> Thanks
> Jack
>
> --
> 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/bb4a603b-c8f0-4bc2-a151-fcb51f905515%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/CAH%2BKTJ4V_VUasYNtqOEeOppDykgzv7PjJkgBDk%2BbLbLXgQhU%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible windows 8.1 management...

2015-04-16 Thread Chris Church
Ansible reports "ok" for a script if the return code is 0.  PowerShell
scripts don't normally return a nonzero exit code even if there is an
error.  You'll need to use a trap construct or try/catch block to exit with
a different code and display an error message, e.g.:

https://github.com/ansible/ansible/blob/devel/test/integration/roles/test_win_script/files/test_script_with_errors.ps1


The groups and groups_action options weren't added to the win_user module
until 1.9.

If you run ansible with the -v option you'll see the stdout/stderr from
your script, and can turn on additional debugging output using additional
v's (up to -v).


On Wed, Apr 15, 2015 at 10:34 PM, Michael Legleux  wrote:

> *Ansible 1.8.4 on ubuntu 12.04 to connect to windows 8.1* guest vm using
> literally the exact same windows module examples from the ansible
> documentation.
> ansible -m win_ping and -m setup work great.
> 2 Problems standing in my way
> 1. I am trying to mount a network drive using ansible. The play is simply:
>
> - name: 'Mount drive to T'
>   hosts: windows
>   tasks:
> script: mount_drive.ps1
>
> mount_drive.ps1 is simply
> New-PSDrive -Name T -PSProvider FileSystem -Root
> \\some_mountable_drive\dir -Persist
>
> When this is executed, ansible happily reports the play recap it was "ok"
> which is a lie.
>
> I know that this works because I have run the command while logged in on
> the windows guest as the user in question and the drive is mounted
> immediately.
> *I also used the win_rm python module to execute this command with success*.
> I define "success" a little looser here because the drive doesn't appear
> immediately, but after logout/login but I chalk that up to windows bs.
>
> If the command works (almost) perfectly with the python win_rm module. I
> can't figure out what am i doing wrong with the ansible play.
>
> Problem 2:
> - name: Add user
>   hosts: windows
>   tasks:
> - name: Add newuser
>   win_user:
> name: anewuser
> password: "s"
> groups_action: replace # with or without this matters not
> groups: ["Users","Administrators"]
>
> The user is created fine via inspection with lsusrmgr, however the user is
> not added to those groups
>
> please point me in the right direction. Also some way to get meaningful
> output from the remote commands would be nice. win_rm captures the stdout
> and err from powershell commands, which is how I debugged the win_rm python
> module to mount the drive just fine.
>
> --
> 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/6075ae5c-cf3f-4db0-aa2e-cdad3d04cd90%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/CAH%2BKTJ4vW5GVu1WgX7cC1ZbSm6c9gWCt-kb0W0KL6bNP%2BBomgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Windows Hosts Setup

2015-04-15 Thread Chris Church
The intro to Windows documentation assumes you have some familiarity with
how to define your inventory and specify group and host variables (
http://docs.ansible.com/intro_inventory.html).

Since you mentioned version 2.1.1, I assume you're using Tower.  In this
case, you can use the Tower UI to create an inventory and specify the
variables for each group or host.  You wouldn't need to create an inventory
file or group_vars/windows.yml file in that case.

For additional Tower-related questions, contact supp...@ansible.com.


On Wed, Apr 15, 2015 at 1:22 PM, Ravi Kanth  wrote:

> Dear All,
>
> I am new to ansible and i have installed latest version 2.1.1 in our
> environment.
>
> i was trying to add windows hosts to our inventory and i am following the
> ansible documentation "http://docs.ansible.com/intro_windows.html";
> however i have small doubts in this.
>
> In the document it was mentioned that
>
> "In group_vars/windows.yml, define the following inventory variables:
>
> # it is suggested that these be encrypted with ansible-vault:
> # ansible-vault edit group_vars/windows.yml
>
> ansible_ssh_user: Administrator
> ansible_ssh_pass: SecretPasswordGoesHere
> ansible_ssh_port: 5986
> ansible_connection: winrm "
>
> can any please tell me exact location where i have to create the file or 
> where i have update if it already exist.
>
> Thanks in Advance.
>
>  --
> 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/cf371af3-56dd-4347-a231-ed21810b2631%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/CAH%2BKTJ7WHjr6GiUOhW71VChiJpjT%3D_VqLvCLYmDXKOqW7w3YmQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible refuse to execute command with "-p"

2015-04-14 Thread Chris Church
It appears to be related to this issue
https://github.com/ansible/ansible/issues/10332 which has been fixed in
1.9, so I'd suggest updating to the latest version of ansible.


On Tue, Apr 14, 2015 at 1:18 AM, yaniv refael 
wrote:

> Hi,
>
> My host machine is windows 8.1 and the guest is widows 2012 R2
> I have simple command that I run with power shell with ansible  "dsmcl -p
> 123456".
> I get the flowing error:
>
> Traceback (most recent call last):
>   File
> "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
> line 149, in exec_command
> result = self._winrm_exec(cmd_parts[0], cmd_parts[1:], from_exec=True)
>   File
> "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
> line 124, in _winrm_exec
> v('WINRM STDERR %s' % response.std_err, host=self.host)
>   File
> "/usr/lib/python2.7/site-packages/ansible/runner/connection_plugins/winrm.py",
> line 45, in v
> verbose(msg, host=host, caplevel=4)
>   File "/usr/lib/python2.7/site-packages/ansible/callbacks.py", line 190,
> in verbose
> msg = utils.sanitize_output(msg)
>   File "/usr/lib/python2.7/site-packages/ansible/utils/__init__.py", line
> 1002, in sanitize_output
> parts = parse_kv(str)
>   File "/usr/lib/python2.7/site-packages/ansible/utils/__init__.py", line
> 793, in parse_kv
> vargs = split_args(args)
>   File
> "/usr/lib/python2.7/site-packages/ansible/module_utils/splitter.py", line
> 184, in split_args
> raise Exception("error while splitting arguments, either an unbalanced
> jinja2 block or quotes")
> Exception: error while splitting arguments, either an unbalanced jinja2
> block or quotes
>
> if I execute the same command with any other letter (except -p it works
> fine)
>
> nay suggestion?
>
> --
> 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/359339ed-df0e-4e55-ad7b-a2a6559eaf5f%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/CAH%2BKTJ5dzADZp-%2B%2B5jCO12idOaME4OPB_WF2otyNqMffR4F9bA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Failing to connect to Windows clients with 1.9.0 -- No credentials cache file found

2015-04-09 Thread Chris Church
A fix has been merged via https://github.com/ansible/ansible/pull/10664
(similar to Jon's changes in https://github.com/ansible/ansible/pull/10644)
and pending docs changes in https://github.com/ansible/ansible/issues/10665.

The winrm connection will only try kerberos if it is installed and the
username contains @.  Anything after the @ would be used to specify the
kerberos realm (if pywinrm didn't ignore the realm at the moment).

Let me know if it makes sense, gets rid of the error you are experiencing,
and/or breaks things horribly.


On Fri, Apr 3, 2015 at 4:09 PM, J Hawkesworth <
j.r.hawkeswo...@googlemail.com> wrote:

> I'm not sure there's a one-size fits all solution to this.
>
> Personally I use a callback plugin to call kinit and acquire the necessary
> kerberos ticket whenever I start running a playbook.  This works for me as
> I want my ansible controller to be able to work with > 1 domain. Its not
> ideal as it will only work for ansible-playbook and not ansible commands.
> I've read that others use a local action to call kinit as their first task
> and I believe others are happy to have an ansible controller per domain and
> have kinit set up the kerberos ticket when you log in.
>
> Jon
>
> On Monday, March 30, 2015 at 11:33:32 PM UTC+1, Peter Loron wrote:
>>
>> Well, apparently there's *some* kind of python glue installed. I did
>> kinit to acquire a ticket for the appropriate user, and I was able to get
>> it to work.
>>
>> There still needs to be a switch. I don't want to muck about with kinit
>> every time I want to run playbooks.
>>
>> On Monday, March 30, 2015 at 2:26:23 PM UTC-7, Peter Loron wrote:
>>>
>>> As far as I know, I do not have pykerberos installed. If I start the
>>> default python and do "import kerberos", it fails.
>>>
>>> Regardless, there should be an option to force the connection type.
>>>
>>> On Sunday, March 29, 2015 at 2:56:26 PM UTC-7, J Hawkesworth wrote:

 If I recall, if you have pykerberos installed, winrm will attempt
 kerberos connection.

 I guess your options are to remove pykerberos or use knit to acquire a
 kerberos ticket and connect as a domain user.

 Hope that helps.

 Jon
>>>
>>>  --
> 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/cd6a5785-650d-46f5-a0cf-40706787025a%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/CAH%2BKTJ559L4x70BXXsBDV90F_G8Pc%3D%2Bs56qv4RFiqwOqT8n52Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Connection refused

2015-04-02 Thread Chris Church
Your windows.yml should be in a "group_vars" subdirectory for ansible to
pick up those variables.

Alternately, for a few simple variables, you can add those directly to your
hosts file:

[windows]
ComputerName

[windows:vars]
ansible_ssh_user=ansible
ansible_ssh_pass=ansible123
ansible_ssh_port=5986
ansible_connection=winrm


On Thu, Apr 2, 2015 at 1:31 PM, skinnedknuckles <
andersonjonatha...@gmail.com> wrote:

> I'm having trouble getting win_ping to work with or without SSL.  Here are
> my details...
>
>
> CentOS Linux release 7.1.1503 (Core)
>
> ansible 1.8 (devel 57d2622c8c) last updated 2014/10/17 18:19:13 (GMT -500)
>
>
> using pywinrm-0.0.3-py2.7
>
>
> I started winrm on the remote node using this script from Hindenes/Church
> 
>
>
> windows.yml file contains...
>
>
>  ansible_ssh_user: ansible
>
> ansivle_ssh_pass: ansible123
>
> ansible_ssh_port: 5986
>
> ansible_connection: winrm
>
>
>
> hosts file contains...
>
> [windows]
> ComputerName
>
>
>
>
> This is my output when trying to run win_ping
>
> [ansmgr@dhcp1-60-20 ansible]$ ansible windows -m win_ping -
>
> http://ads-6999.am.ad.seagate.com>> ESTABLISH
> CONNECTION FOR USER: ansmgr
>
> http://ads-6999.am.ad.seagate.com>> REMOTE_MODULE
> win_ping
>
> http://ads-6999.am.ad.seagate.com>> EXEC ssh -C -tt
> -vvv -o ControlMaster=auto -o ControlPersist=60s -o
> ControlPath=/home/ansmgr/.ansible/cp/ansible-ssh-%h-%p-%r -o
> KbdInteractiveAuthentication=no -o PreferredAuthentications=
> gssapi-with-mic,gssapi-keyex,hostbased,publickey -o
> PasswordAuthentication=no -o ConnectTimeout=10 www.example.com
>  /bin/sh -c 'mkdir -p
> $HOME/.ansible/tmp/ansible-tmp-1427994666.99-36837830948182 && chmod a+rx
> $HOME/.ansible/tmp/ansible-tmp-1427994666.99-36837830948182 && echo
> $HOME/.ansible/tmp/ansible-tmp-1427994666.99-36837830948182'
>
> www.example.com  | FAILED => SSH
> encountered an unknown error. The output was:
>
> OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013
>
> debug1: Reading configuration data /etc/ssh/ssh_config
>
> debug1: /etc/ssh/ssh_config line 56: Applying options for *
>
> debug1: auto-mux: Trying existing master
>
> debug1: Control socket 
> "/home/ansmgr/.ansible/cp/ansible-ssh-www.example.com-22-ansmgr"
> does not exist
>
> debug2: ssh_connect: needpriv 0
>
> debug1: Connecting to www.example.com 
> [123.123.123.123] port 22.
>
> debug2: fd 3 setting O_NONBLOCK
>
> debug1: connect to address 123.123.123.123 port 22: Connection refused
>
> ssh: connect to host www.example.com 
> port 22: 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 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/e6fb0ae9-100d-4ad5-aec1-8f48ed7e664d%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/CAH%2BKTJ7QUH4WTSQUpDHSfsiS4sOkKmHTp3HP05WY6pCdJ6A%3D7g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible Windows Connections - 4 second initialization? Pipelining?

2015-04-02 Thread Chris Church
Hi Amir,

The biggest issue here is that the pywinrm library uses urllib2, which
doesn't natively support keep-alive connections.  Due to the way PowerShell
remoting works, each command requires at least 4 HTTP requests and must
make a new connection for each one.

I have a fork of pywinrm using requests instead, which seems to help
significantly with performance.  I need to find time to finish up a few
parts of it, but you're welcome to try and see how it works for you.

https://github.com/cchurch/pywinrm/blob/transport-refactor/winrm/requests_transport.py



On Thu, Apr 2, 2015 at 4:35 AM, Amir Luzon  wrote:

> Hi guys,
>
> I'm doing a POC of Ansible for my company. We have a mixture of Linux and
> Windows servers.While playing around with windows i found that just running
> a simple powershell script which does "exit 0" will take about 4 seconds
> every time.
>
> I am not sure why this is the case, i tried to enable Pipelining but it
> seems that this is for SSH connections only and not for windows Powershell
> connections.
>
> here is an example run i did:
>
> PLAY RECAP
> 
> base | Unzip Package ---
> 24.62s
> Update Web.Config2 --
> 3.85s
> Update Web.Config1 --
> 3.82s
> Update Web.Config3 --
> 3.78s
>
> The "Update Web.Config" tasks just run the simple powershell script which
> basically does nothing.
>
> Since we are testing Ansible as a viable CI component I will need to solve
> this or else Ansible will not be viable for our usages due to the overkill
> of 4 seconds per task.
>
> Can anyone please assist?
>
> --
> 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/55d7d6a7-75d5-4cb4-8454-876f342d78bf%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/CAH%2BKTJ4V%2B%3DW657EJoXvQfB2h%3DFnfnkWzpL7875RfQP5osBT1Xw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Not able to configure server using Ansible Dynamic Inventory

2015-03-03 Thread Chris Church
The inventory script is only invoked at the beginning of the playbook run.

You'll have to call your provisioning and configure playbooks separately,
or use add_host (http://docs.ansible.com/add_host_module.html) to update
the inventory in memory after you have provisioned a host.


On Fri, Feb 27, 2015 at 6:38 PM, Rahul Mehrotra  wrote:

> I am using ec2.py dynamic inventory for provisioning with ansible. I have
> placed the ec2.py in /etc/ansible/hosts file and marked it executable. I
> also have the ec2.ini file in /etc/ansible/hosts.
>
> [ec2]
>
> regions = us-west-2 regions_exclude = us-gov-west-1,cn-north-1
>
> destination_variable = public_dns_name
>
> vpc_destination_variable = ip_address route53 = False
>
> all_instances = True all_rds_instances = False
>
> cache_path = ~/.ansible/tmp
>
> cache_max_age = 0
>
> nested_groups = False group_by_instance_id = True group_by_region = True
> group_by_availability_zone = True group_by_ami_id = True
> group_by_instance_type = True group_by_key_pair = True group_by_vpc_id =
> True group_by_security_group = True group_by_tag_keys = True
> group_by_tag_none = True group_by_route53_names = True group_by_rds_engine
> = True group_by_rds_parameter_group = True
>
> Above is my ec2.ini file
>
> ---
> - hosts: localhost
>   connection: local
>   gather_facts: yes
>   vars_files:
>- ../group_vars/dev_vpc
>- ../group_vars/dev_sg
>- ../hosts_vars/ec2_info
>   vars:
> instance_type: t2.micro
>   tasks:
>- name: Provisioning EC2 instance
>  local_action:
>  module: ec2
>  region: "{{ region }}"
>  key_name: "{{ key }}"
>  instance_type: "{{ instance_type }}"
>  image: "{{ ami_id }}"
>  wait: yes
>  group_id: ["{{ sg_npm }}", "{{sg_ssh}}"]
>  vpc_subnet_id: "{{ PublicSubnet }}"
>  source_dest_check: false
>  instance_tags: '{"Name": "EC2", "Environment": "Development"}'
>  register: ec2
>   - name: associate new EIP for the instance
> local_action:
>   module: ec2_eip
>   region: "{{ region }}"
>   instance_id: "{{ item.id }}"
>   with_items: ec2.instances
>   - name: Waiting for NPM Server to come-up
> local_action:
>   module: wait_for
>   host: "{{ ec2 }}"
>   state: started
>   delay: 5
>   timeout: 200
>  - include: ec2-configure.yml
>
> Now the configuring script is as follows
>
> - name: Configure EC2 server
>   hosts: tag_Name_EC2
>   user: ec2-user
>   sudo: True
>   gather_facts: True
>   tasks:
>- name: Install nodejs related packages
>  yum: name={{ item }} enablerepo=epel state=present
>  with_items:
>   - nodejs
>   - npm
>
> However when the configure script is called, the second script results
> into no hosts found. If I execute the ec2-configure.yml just alone and if
> the EC2 server is up & running then it is able to find it and configure it.
>
> I added the wait_for to make sure that the instance is in running state
> before the ec2-configure.yml is called.
>
> Would appreciate if anyone can point my error. Thanks
>
>  --
> 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/6855782c-0a6d-4d04-aceb-7e07c7e35ed1%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/CAH%2BKTJ7uYT2b0GKr-7vt4bzBkKjV1QnfJbQoZ3pvYupBFcgOzQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Setting ansible_sudo_pass in ansible.cfg?

2015-03-03 Thread Chris Church
It's not possible in ansible.cfg, but could be set in inventory for all
hosts, e.g.

[all]
host1
host2

[all:vars]
ansible_sudo_pass=MakeMeASammich




On Tue, Mar 3, 2015 at 7:30 AM, Simón Muñoz  wrote:

> Hi all,
>
> is it possible to set ansible_sudo_pass in /etc/ansible/ansible.cfg to
> avoid having to enter the sudo pass in a group of local clients?
>
> Thanks in advance, Simon.
>
> --
> 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/59c13ea7-1c1f-4fd7-abd0-4eaccdb2aacc%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/CAH%2BKTJ4-KXetLYV6y6X185CxA2ya5W6mVgU59tVJ%2BEX20TNArQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] EC2 Inventory plugin AND

2015-02-25 Thread Chris Church
Not at the moment.  It's possible via boto and the EC2 API.  I'd propose
using a syntax such as:

instance_filters = tag:env=stage&tag:Owner=me



On Tue, Feb 24, 2015 at 6:46 PM, Daniel Richardson 
wrote:

> Is there any way to use AND in the instance_filters parameter instead of
> OR?
>
> For instance I would like to be able to filter on
> tag:env=stage
> AND
> tag:Owner=me
>
> --
> 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/be3d35af-c239-4209-a548-c658d07a40a1%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/CAH%2BKTJ5egXicrNJyAw20NmuQo6c__PimZXvrBCRLPE3nn9i85g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] match() documentation bug?

2015-02-25 Thread Chris Church
The Python docs for match vs. search also use wording similar to what
you've suggested:

https://docs.python.org/library/re.html#search-vs-match


You're welcome to submit a pull request for this change to the docs.


On Wed, Feb 25, 2015 at 2:09 PM, Nusenu  wrote:

> Hi,
>
> I'd say the documentation [1] for match() is not entirely clear:
>
> "‘match’ will require a complete match in the string, while ‘search’
> will require a match inside of the string."
>
> after reading this I wouldn't expect that
> abc|match("a") is true.
>
>
> I run this on ansible 1.8.2:
>
>   vars:
> input: abc
>   tasks:
>   - shell: msg="abc matches a?"
> when: input|match("a")
>
>   - shell: msg="abc matches ^a$?"
> when: input|match("^a$")
>
>   - shell: msg="abc matches b?"
> when: input|match("b")
>
>
> A better wording of the current behaviour would be:
>
> "‘match’ will require a complete match at the beginning of the string"
>
>
>
> [1] http://docs.ansible.com/playbooks_variables.html
>
> --
> 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/54EE1DD3.6070608%40openmailbox.org
> .
> 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/CAH%2BKTJ54tujL9eygAqJFu-SvKOgEZoCEquv0b%2BMDg%2BGPR%3DNbqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible quoting

2015-02-23 Thread Chris Church
Add your new test role to test/integration/test_winrm.yml with a matching
tag, then run:

TEST_FLAGS="-t test_powershell_filter" make test_winrm


It may be worthwhile to add to the test_win_script role to make sure your
filter works for passing parameters to a PowerShell script.

Also, from your test playbook, there is no echo module - maybe you meant to
use command instead?


On Mon, Feb 23, 2015 at 12:39 PM, Michael Perzel 
wrote:

> This isn't directly related to this thread but it was discussed earlier so
> it was the best place for it.
>
> I created a filter that converts a yaml dict to a powershell hash. I'm
> trying to write some tests for it but I'm not sure how to run just my
> specific test. The file playbook and vars are
> at ansible/test/integration/roles/test_powershell_filter/ and the filter is
> at ansible/lib/ansible/runner/filter_plugins.
>
> Test playbook:
> https://gist.github.com/perzizzle/8fb875895b218772eede
> Test variables
> https://gist.github.com/perzizzle/dc73025a2232f2da9b88
> Filter
> https://gist.github.com/perzizzle/117a6b139e2a97194d5f
>
> When I run "make tests" a whole bunch of them succeed but one fails
> related to postgres. Is it possible to run just my one test I've created?
>
> Thanks,
>
> On Wednesday, February 4, 2015 at 1:44:00 AM UTC-6, Chris Church wrote:
>>
>> Hi Michael,
>>
>> I had submitted a PR (https://github.com/ansible/ansible/pull/9602) --
>> I'll see if I can get that merged soon.
>>
>>
>> On Mon, Jan 26, 2015 at 2:47 PM, Michael Perzel 
>> wrote:
>>
>>> I ended up creating a new filter that could transform
>>>
>>>
>>> installArguments:
>>>
>>>   key: value
>>>
>>>   key2: value2
>>>
>>> and return “@{'key2'='value2';'key'='value';}” I can share if anyone is
>>> interested.
>>>
>>> I just upgraded to ansible 1.8 and made your fix to powershell.py and
>>> winrm.py manually again. Is there any target version to get this into the
>>> main branch? I poked around in github but couldn't find way to see if you
>>> had submitted a pull request for this.
>>>
>>>
>>> On Thursday, November 6, 2014 at 5:26:49 PM UTC-6, Chris Church wrote:
>>>>
>>>> Absolutely, just haven't had a chance to get back to Windows-related
>>>> things this week.
>>>>
>>>> On Thu, Nov 6, 2014 at 4:37 PM, Michael Perzel 
>>>> wrote:
>>>>
>>>>> Are you going to submit a pull request for this into devel? It
>>>>> definitely solved my issue.
>>>>>
>>>>> On Saturday, October 25, 2014 2:23:55 PM UTC-5, Chris Church wrote:
>>>>>>
>>>>>> Could you create a gist (https://gist.github.com/) with the relevant
>>>>>> lines from your inventory variables, playbook and script (removing any
>>>>>> sensitive information)?  I'm not quite able to piece together a full
>>>>>> example of what you're running from the email thread.
>>>>>>
>>>>>> My branch is based on devel; I just created another branch based on
>>>>>> 1.7.2 with the splatting changes applied: https://github.com/cc
>>>>>> hurch/ansible/tree/powershell_splatting_v172
>>>>>> <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fcchurch%2Fansible%2Ftree%2Fpowershell_splatting_v172&sa=D&sntz=1&usg=AFQjCNELYa0RJWKIxEmXb2bqZVp5y1NogA>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Fri, Oct 24, 2014 at 6:12 PM, Michael Perzel 
>>>>>> wrote:
>>>>>>
>>>>>>> I tried taking your changes but it failed with:
>>>>>>> http://schemas.microsof
>>>>>>> t.com/powershell/2004/04">C:\Users\ansible\App
>>>>>>> Data\Local\Temp\ansible-tmp-1414187414.25-97343749557638\de_x000D__x000A_>>>>>> S="Error">ployLauncher.ps1 : A positional parameter cannot be found that
>>>>>>> accepts _x000D__x000A_argument
>>>>>>> 'False'._x000D__x000A_At line:1 
>>>>>>> char:1_x000D__x000A_>>>>>> S="Error">+ & _x000D__x000A_C:\Users\ansible\
>>>>>>> AppData\Local\Temp\ansible-tmp-1414187414.25-97343749557638\\
>>>>>>> _x000D__x000A_..._x000D__x000A_+
>>>>

Re: [ansible-project] Re: Processing registered result of ec2 with_items

2015-02-12 Thread Chris Church
You might want to try with_sublements (
http://docs.ansible.com/playbooks_loops.html#looping-over-subelements) -
note the use of item.1 instead of just item:

- name: Add new servers to group for configuration
  local_action: add_host hostname={{item.1.public_dns_name}}
groupname={{ec2_groupname}}
  with_subelements:
- ec2.results
- instances
  when: ec2.changed



On Wed, Feb 11, 2015 at 11:45 AM, James Morgan 
wrote:

> Hi,
>
> Did you find a solution to this? Having a similar issue
>
> J
>
>
>  --
> 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/ee6699a9-c8dc-44b5-ac96-d262c8c39747%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/CAH%2BKTJ7%3DF4wzOi6pWY1PthgevGtaO%2BbTs%3DM6jQe3008X1NK7Qg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible 1.8.2 custom windows powershell module defined in roles/myrole/library is not found (ERROR: mymodule is not a legal parameter in an Ansible task or handler)

2015-02-12 Thread Chris Church
Create an empty mymodule.py file alongside mymodule.ps1; that should allow
the playbook to determine that mymodule is a valid module name.

Previously discussed here:
https://groups.google.com/d/topic/ansible-project/FMlVKR9gDS8/discussion


On Wed, Feb 11, 2015 at 1:15 PM, Ian Clegg  wrote:

> Hi everyone,
>
> I wonder if anyone has hit this issue. I just upgraded to ansible 1.8.2
> and a set of windows playbooks is no longer working. These playbooks _do_
> work with the previous version we had; there seem to be some issues around
> this at the moment.
>
> The problem appears to be related to how ansible locates custom powershell
> modules defined in a roles library.
>
> Lets look at how the play is laid out, its quite simple:
>
> */roles/myrole/tasks/main.yml*
> - name: Run my custom module
>   mymodule: myparam='hello world'
>
> */roles/myrole/library/mymodule.ps1*
> ... a custom powershell module
>
> */myplay.yml*
> - name: MYROLE
>   hosts: my-servers
>   gather_facts: no
>   vars_files:
> - "{{versions_vars_file}}"
> - "{{environment_vars_file}}"
>   roles:
> - myrole
>
> lets invoke ansible:
> ansible-playbook -i inventory myplay.yml -c winrm
>
> ERROR: mymodule is not a legal parameter in an Ansible task or handler
>
> This worked in 1.7.x
>
> I should point out that I am setting both 'ansible_connection' to winrm
> and passing '-c winrm' in the command line. I would expect powershell
> modules to be found.
>
> This seems to be a bug in how find_plugin() in /ansible/utils/plugins.py
> is invoked. When I patched the function to log the value of transport
> parameter I got:
> transport: ['.py']
> transport: ['.py', '']
> transport: ['.py', '']
> So it was an empty string and the suffix was always '.py'.
>
> If I patch the 1.8.2 find_plugin() function to add '.ps1' to the suffix
> list (even when transport is empty) then my problem goes away - I guess,
> that transport should probably not be empty?
>
> Thanks
> Ian
>
>
>
>
>
>  --
> 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/b2446014-4606-49e5-b667-21c980cce5ff%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/CAH%2BKTJ4Cott6f9HaiD2CkieKqXU_ogm%3DrPpxcXnXfszFYggQVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: [ansible-devel] Developing the vmware inventory script

2015-02-11 Thread Chris Church
It's still using psphere, but adds some default groups and facts that could
be used with group_by to create additional groups.  There's not (yet) any
filtering equivalent to instance_filters in ec2.py.

On Wed, Feb 11, 2015 at 10:25 AM, Brian Coca  wrote:

> I just merged changes from tower team into main ansible repo, i
> believe it adds some more filtering
>
>
>
>
> --
> Brian Coca
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-devel+unsubscr...@googlegroups.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/CAH%2BKTJ658xernqtqVSM-w50M%2BAPUoiaaS6qwyAqVNqZn_CSXzw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Is it possible to created a numbered list from a with_sequence loop?

2015-02-04 Thread Chris Church
with_indexed_items -
http://docs.ansible.com/playbooks_loops.html#looping-over-a-list-with-an-index


On Wed, Feb 4, 2015 at 12:54 PM,  wrote:

> I'm attempting to create a playbook for zookeeper. The playbook is
> designed as a part of a role which is deployed after an AWS provisioning
> takes place. Due to the configuration of zookeeper, each host requires a
> zookeeper id (myid). This id is unique to each host in your cluster and
> must be applied before starting the service and for configuring the config
> file of zookeeper. I've seen some previous examples using a host_var that
> is configured in the inventory file for the zookeeper group, however, this
> will not work correctly with my implementation because I am using AWS to
> provision the hosts. My plan was to create a numbered list [1,2,3] for the
> length of the group list, and then use with_together to loop through and
> assign the ids to each host. See below for an example.
>
> - debug:
> msg: "My host is {{ item.0 }} and my id is {{ item.1 }}"
>   run_once: true
>   with_together:
> - "{{ groups['newec2hosts'] }}"
> - [1,2,3]
>
> The example above works fine since the list of numbers is provided,
> however, I'd like to keep this dynamic so I don't need to be constantly
> changing the list of ids when I want to add a host to the cluster. The more
> optimal solution is something like the following
>
> - set_fact:
> zid_test: "{{ item }}"
>   with_sequence: "count={{ groups['newec2hosts'] | length }}"
>
> - debug:
> msg: "Test: {{ item.0 }} and id {{ item.1 }}"
>   run_once: true
>   with_together:
> - "{{ groups['newec2hosts'] }}"
> - "{{ zid_test }}"
>
> That doesn't work since the fact is only set to the total length of the
> group list (3) and not in the order list [1,2,3]
>
> Is there a way to accomplish this? Or perhaps another way of assigning the
> ids dynamically to each host?
>
>
>
>
>
>
>  --
> 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/1509f2b1-8e74-41d4-854f-c46f012e2812%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/CAH%2BKTJ7yMc6kpSOdLPvQaQ5zgQeGWEhEF7SEBcUJC2aO%3DFjSrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible quoting

2015-02-03 Thread Chris Church
Hi Michael,

I had submitted a PR (https://github.com/ansible/ansible/pull/9602) -- I'll
see if I can get that merged soon.


On Mon, Jan 26, 2015 at 2:47 PM, Michael Perzel 
wrote:

> I ended up creating a new filter that could transform
>
>
> installArguments:
>
>   key: value
>
>   key2: value2
>
> and return “@{'key2'='value2';'key'='value';}” I can share if anyone is
> interested.
>
> I just upgraded to ansible 1.8 and made your fix to powershell.py and
> winrm.py manually again. Is there any target version to get this into the
> main branch? I poked around in github but couldn't find way to see if you
> had submitted a pull request for this.
>
>
> On Thursday, November 6, 2014 at 5:26:49 PM UTC-6, Chris Church wrote:
>>
>> Absolutely, just haven't had a chance to get back to Windows-related
>> things this week.
>>
>> On Thu, Nov 6, 2014 at 4:37 PM, Michael Perzel 
>> wrote:
>>
>>> Are you going to submit a pull request for this into devel? It
>>> definitely solved my issue.
>>>
>>> On Saturday, October 25, 2014 2:23:55 PM UTC-5, Chris Church wrote:
>>>>
>>>> Could you create a gist (https://gist.github.com/) with the relevant
>>>> lines from your inventory variables, playbook and script (removing any
>>>> sensitive information)?  I'm not quite able to piece together a full
>>>> example of what you're running from the email thread.
>>>>
>>>> My branch is based on devel; I just created another branch based on
>>>> 1.7.2 with the splatting changes applied: https://github.com/cc
>>>> hurch/ansible/tree/powershell_splatting_v172
>>>> <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fcchurch%2Fansible%2Ftree%2Fpowershell_splatting_v172&sa=D&sntz=1&usg=AFQjCNELYa0RJWKIxEmXb2bqZVp5y1NogA>
>>>>
>>>>
>>>>
>>>>
>>>> On Fri, Oct 24, 2014 at 6:12 PM, Michael Perzel 
>>>> wrote:
>>>>
>>>>> I tried taking your changes but it failed with:
>>>>> http://schemas.microsof
>>>>> t.com/powershell/2004/04">C:\Users\ansible\App
>>>>> Data\Local\Temp\ansible-tmp-1414187414.25-97343749557638\de_x000D__x000A_>>>> S="Error">ployLauncher.ps1 : A positional parameter cannot be found that
>>>>> accepts _x000D__x000A_argument
>>>>> 'False'._x000D__x000A_At line:1 
>>>>> char:1_x000D__x000A_>>>> S="Error">+ & _x000D__x000A_C:\Users\ansible\App
>>>>> Data\Local\Temp\ansible-tmp-1414187414.25-97343749557638\\
>>>>> _x000D__x000A_..._x000D__x000A_+
>>>>> 
>>>>> ~_x000D__x000A_~~~_x000D__x000A_>>>> S="Error"> + CategoryInfo : InvalidArgument: (:) [deployLauncher.ps1],
>>>>> Param _x000D__x000A_ 
>>>>> eterBindingException_x000D__x000A_>>>> S="Error"> + FullyQualifiedErrorId : PositionalParameterNotFound,de
>>>>> ployLauncher.ps1_x000D__x000A_
>>>>> _x000D__x000A_
>>>>>
>>>>> Looking at the diff between your code and mine there's a few other
>>>>> differences. I'm running 1.7.2,  I assume your branched off something
>>>>> newer.I'll see if I can sort through the issue.
>>>>>
>>>>> Thanks
>>>>>
>>>>> On Friday, October 24, 2014 3:52:39 PM UTC-5, Michael Perzel wrote:
>>>>>>
>>>>>> Your idea with jinja filter is what I originally tried to get
>>>>>> working. I never managed it but I think its the ideal solution 
>>>>>> (converting
>>>>>> yaml hash to a powershell one).
>>>>>>
>>>>>> If I follow your patch you added a parameter that controls whether or
>>>>>> not arguments get quoted (and set it to false for powershell scripts)? 
>>>>>> I'm
>>>>>> not particularly worried about nefarious activity within our system so 
>>>>>> this
>>>>>> could work for us.
>>>>>>
>>>>>> On Friday, October 24, 2014 12:52:52 AM UTC-5, Chris Church wrote:
>>>>>>>
>>>>>>> That method of passing arguments is apparently called "splatting" (
>>>>>>> http://techne

Re: [ansible-project] ansible windows error

2015-01-16 Thread Chris Church
I've found and submitted a fix:
https://github.com/ansible/ansible/pull/10024

On Fri, Jan 16, 2015 at 1:11 PM, Chris Church  wrote:

> I'm able to reproduce against a French AMI (ami-4cff9b24) by running:
>
> ansible -i inventory -m raw -a "ipconfig" - windows
>
>
> I'm working on a fix, and trying to determine if it's really an ansible or
> pywinrm issue.
>
>
> On Fri, Jan 16, 2015 at 2:40 AM, lozair31  wrote:
>
>> We attempt to use here ansible 1.8.2 to manage windows servers 2008 ->
>> 2012.
>> We attempt to test actually on windows 2012 server with PowerShell 4 and
>> using french LangPack
>> We have followed the ansible documentation for windows server
>> configuration and winrm module installation on ansible server.
>>
>> When we attempt to launch the win-ping module on this server, the ansible
>> server attempt to gather facts using a script named setup.ps1.
>>
>> Ansible break on this fact gathering with the following error :
>>
>>
>> $ ansible-playbook --limit test-windows2 windows_inventory.yml -vv
>>
>> PLAY [grp-windows]
>> 
>>
>> GATHERING FACTS
>> ***
>>  REMOTE_MODULE setup
>> fatal: [test-windows2] => Traceback (most recent call last):
>>   File "/usr/lib/pymodules/python2.7/ansible/runner/__init__.py", line
>> 590, in _executor
>> exec_rc = self._executor_internal(host, new_stdin)
>>   File "/usr/lib/pymodules/python2.7/ansible/runner/__init__.py", line
>> 792, in _executor_internal
>> return self._executor_internal_inner(host, self.module_name,
>> self.module_args, inject, port, complex_args=complex_args)
>>   File "/usr/lib/pymodules/python2.7/ansible/runner/__init__.py", line
>> 1025, in _executor_internal_inner
>> result = handler.run(conn, tmp, module_name, module_args, inject,
>> complex_args)
>>   File
>> "/usr/lib/pymodules/python2.7/ansible/runner/action_plugins/normal.py",
>> line 57, in run
>> return self.runner._execute_module(conn, tmp, module_name,
>> module_args, inject=inject, complex_args=complex_args)
>>   File "/usr/lib/pymodules/python2.7/ansible/runner/__init__.py", line
>> 555, in _execute_module
>> res = self._low_level_exec_command(conn, cmd, tmp, sudoable=sudoable,
>> in_data=in_data)
>>   File "/usr/lib/pymodules/python2.7/ansible/runner/__init__.py", line
>> 1173, in _low_level_exec_command
>> in_data=in_data)
>>   File
>> "/usr/lib/pymodules/python2.7/ansible/runner/connection_plugins/winrm.py",
>> line 153, in exec_command
>> return (result.status_code, '', result.std_out.encode('utf-8'),
>> result.std_err.encode('utf-8'))
>> UnicodeDecodeError: 'ascii' codec can't decode byte 0x8a in position 53:
>> ordinal not in range(128)
>>
>>
>> I attempt to run directly the setup.ps1 script on the server which
>> generate error.
>> This error is printed with french characters which perhaps generate the
>> UnicodeDecodeError.
>>
>> Anyone can confirm it use ansible on windows servers with non english
>> langpack ?
>>
>> Thanks for your help
>>
>> --
>> 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/f9c89e9b-980e-419e-b1e3-15a74dd11540%40googlegroups.com
>> <https://groups.google.com/d/msgid/ansible-project/f9c89e9b-980e-419e-b1e3-15a74dd11540%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 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/CAH%2BKTJ7iT6Feap8-KEPHQRNVSwKdNoJtwXG34fVqZ56BBMNLcA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible windows error

2015-01-16 Thread Chris Church
I'm able to reproduce against a French AMI (ami-4cff9b24) by running:

ansible -i inventory -m raw -a "ipconfig" - windows


I'm working on a fix, and trying to determine if it's really an ansible or
pywinrm issue.


On Fri, Jan 16, 2015 at 2:40 AM, lozair31  wrote:

> We attempt to use here ansible 1.8.2 to manage windows servers 2008 ->
> 2012.
> We attempt to test actually on windows 2012 server with PowerShell 4 and
> using french LangPack
> We have followed the ansible documentation for windows server
> configuration and winrm module installation on ansible server.
>
> When we attempt to launch the win-ping module on this server, the ansible
> server attempt to gather facts using a script named setup.ps1.
>
> Ansible break on this fact gathering with the following error :
>
>
> $ ansible-playbook --limit test-windows2 windows_inventory.yml -vv
>
> PLAY [grp-windows]
> 
>
> GATHERING FACTS
> ***
>  REMOTE_MODULE setup
> fatal: [test-windows2] => Traceback (most recent call last):
>   File "/usr/lib/pymodules/python2.7/ansible/runner/__init__.py", line
> 590, in _executor
> exec_rc = self._executor_internal(host, new_stdin)
>   File "/usr/lib/pymodules/python2.7/ansible/runner/__init__.py", line
> 792, in _executor_internal
> return self._executor_internal_inner(host, self.module_name,
> self.module_args, inject, port, complex_args=complex_args)
>   File "/usr/lib/pymodules/python2.7/ansible/runner/__init__.py", line
> 1025, in _executor_internal_inner
> result = handler.run(conn, tmp, module_name, module_args, inject,
> complex_args)
>   File
> "/usr/lib/pymodules/python2.7/ansible/runner/action_plugins/normal.py",
> line 57, in run
> return self.runner._execute_module(conn, tmp, module_name,
> module_args, inject=inject, complex_args=complex_args)
>   File "/usr/lib/pymodules/python2.7/ansible/runner/__init__.py", line
> 555, in _execute_module
> res = self._low_level_exec_command(conn, cmd, tmp, sudoable=sudoable,
> in_data=in_data)
>   File "/usr/lib/pymodules/python2.7/ansible/runner/__init__.py", line
> 1173, in _low_level_exec_command
> in_data=in_data)
>   File
> "/usr/lib/pymodules/python2.7/ansible/runner/connection_plugins/winrm.py",
> line 153, in exec_command
> return (result.status_code, '', result.std_out.encode('utf-8'),
> result.std_err.encode('utf-8'))
> UnicodeDecodeError: 'ascii' codec can't decode byte 0x8a in position 53:
> ordinal not in range(128)
>
>
> I attempt to run directly the setup.ps1 script on the server which
> generate error.
> This error is printed with french characters which perhaps generate the
> UnicodeDecodeError.
>
> Anyone can confirm it use ansible on windows servers with non english
> langpack ?
>
> Thanks for your help
>
> --
> 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/f9c89e9b-980e-419e-b1e3-15a74dd11540%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/CAH%2BKTJ59f7gz53ZrwTyCGnJAhKa4WKKy737TqGzcHWMG%3Dxj%2BZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Configuring IAM permissions/roles via module

2015-01-09 Thread Chris Church
There is an open PR for an IAM module (
https://github.com/ansible/ansible-modules-core/pull/590), but nothing
merged that I'm aware of.


On Fri, Jan 9, 2015 at 2:25 PM, Gary Malouf  wrote:

> Are there any roles/module for configuring IAM users, roles, permissions,
> etc?
>
> --
> 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/34796c39-327b-4077-8d04-0ad20a6e6c26%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/CAH%2BKTJ7c4BVATEDrk50Vd4CybLELUet%2BSyg81FacLi_om8TBTg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Module Suffix's and custom windows modules

2015-01-08 Thread Chris Church
I have an idea what's causing the problem, no fix yet.

For now, you can define your tasks as follows and it will work:

- name: install packages
  action:
module: win_exe
exe: 'C:\Users\admin_user\Downloads\myapp.exe'
ArgumentList: '/w /S /v"/l*v
\"C:\Users\admin_user\AppData\Local\Temp\myapp.log\" /qn"'
creates: '{{myapp_root}}/sbin/myapp.exe'



On Thu, Jan 8, 2015 at 11:58 PM, Chris Church  wrote:

> It should work without the suffix.  However, I'm seeing the same issue
> with 1.8, 1.8.1 and 1.8.2.
>
> In my case, it works when using ansible to run an adhoc command, but not
> ansible-playbook:
>
> ansible -i inventory --module-path modules -m win_exe
>
>
> I'll see if I can figure out what's going on...
>
>
> On Thu, Jan 8, 2015 at 11:04 PM, Tony Kinsley 
> wrote:
>
>> I have a custom windows module that I have been using in my playbooks and
>> I just went to update to the version 1.8.2 ( installed with pip ). I went
>> to run a playbook that I run all the time and got this error:
>> /usr/local/bin/ansible-playbook -i ./core/inventory.py --module-path
>> ./modules/ ./main.yml
>> ERROR: win_exe is not a legal parameter in an Ansible task or handler
>>
>> My module is in a file called win_exe.ps1 ( it's basically just runs a
>> windows command but adds in support for the creates keyword ) located
>> ./modules. I changed the playbook to specify
>>
>> - name: install packages
>>   win_exe.ps1:
>> exe: 'C:\Users\admin_user\Downloads\myapp.exe'
>> ArgumentList: '/w /S /v"/l*v
>> \"C:\Users\admin_user\AppData\Local\Temp\myapp.log\" /qn"'
>> creates: '{{myapp_root}}/sbin/myapp.exe'
>>
>>
>> and now it works. I was just wondering whether this is expected and when
>> to expect to require a suffix and when not to expect to need a suffix.
>> Previously I was running ansible version 1.8.
>>
>> Thanks,
>> Tony
>>
>> --
>> 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/a15215e0-1b31-49ee-961d-464d2914b72f%40googlegroups.com
>> <https://groups.google.com/d/msgid/ansible-project/a15215e0-1b31-49ee-961d-464d2914b72f%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 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/CAH%2BKTJ7EHT-Nz5%3DG6B0xFV53ZrsA6FiwpZmbgwm8tgd2h29Nqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Module Suffix's and custom windows modules

2015-01-08 Thread Chris Church
It should work without the suffix.  However, I'm seeing the same issue with
1.8, 1.8.1 and 1.8.2.

In my case, it works when using ansible to run an adhoc command, but not
ansible-playbook:

ansible -i inventory --module-path modules -m win_exe


I'll see if I can figure out what's going on...


On Thu, Jan 8, 2015 at 11:04 PM, Tony Kinsley  wrote:

> I have a custom windows module that I have been using in my playbooks and
> I just went to update to the version 1.8.2 ( installed with pip ). I went
> to run a playbook that I run all the time and got this error:
> /usr/local/bin/ansible-playbook -i ./core/inventory.py --module-path
> ./modules/ ./main.yml
> ERROR: win_exe is not a legal parameter in an Ansible task or handler
>
> My module is in a file called win_exe.ps1 ( it's basically just runs a
> windows command but adds in support for the creates keyword ) located
> ./modules. I changed the playbook to specify
>
> - name: install packages
>   win_exe.ps1:
> exe: 'C:\Users\admin_user\Downloads\myapp.exe'
> ArgumentList: '/w /S /v"/l*v
> \"C:\Users\admin_user\AppData\Local\Temp\myapp.log\" /qn"'
> creates: '{{myapp_root}}/sbin/myapp.exe'
>
>
> and now it works. I was just wondering whether this is expected and when
> to expect to require a suffix and when not to expect to need a suffix.
> Previously I was running ansible version 1.8.
>
> Thanks,
> Tony
>
> --
> 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/a15215e0-1b31-49ee-961d-464d2914b72f%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/CAH%2BKTJ5AWLJBpcqb%3DE3OmAKW3fuF9xwivNmG%2BKAMzfnh-%2BecOA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to use ec2 modules user_data field?

2014-12-25 Thread Chris Church
One issue may be that boto is encoding unicode user data into utf-8, then
base64-encoding it:

https://github.com/boto/boto/blob/develop/boto/ec2/connection.py#L927


So, if we can somehow pass a str() instance to boto instead of a unicode()
instance, it'll skip the utf-8 encoding step.

I've implemented a version of the ec2 module that accepts a user_data_b64
parameter as a base64-encoded string of the user data, and decodes it into
a str() instance before passing to boto:

https://github.com/cchurch/ansible-modules-core/blob/f6522309ffaedace2305fd67a5a5721213f59199/cloud/amazon/ec2.py


You can read the local binary file into a base64-encoded string using the
slurp module, then pass that blob to the ec2 module.  The slurp module
needs an absolute path, so you can use role_path to specify a path relative
to a role, or playbook_dir relative to your top-level playbook.

- local_action: slurp src="{{role_path}}/files/ec2_user_data"
  register: ec2_user_data_b64
- ec2:
user_data_b64: '{{ ec2_user_data_b64.content }}'
...




On Wed, Dec 24, 2014 at 11:10 AM, Daniel Neades 
wrote:

> Incidentally, I also tried using the file lookup plugin on a
> base64-encoded tar file, and then filtering that with Jinja2’s b64decode
> filter. That also fails, though I think it does so at a later stage than
> trying to use the file lookup plugin on a binary file. Using the b64decode
> filter on a looked-up base64-encoded file, one gets an error whose stack
> trace ends something like this:
>
>   File
> "/usr/local/Cellar/ansible/1.8.2/libexec/lib/python2.7/site-packages/ansible/utils/template.py",
> line 362, in template_from_string
> res = jinja2.utils.concat(rf)
>   File "", line 7, in root
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xfd in position 0:
> ordinal not in range(128)
>
> I then thought I’d do a little experiment, and provide the user data as a
> literal (copy-and-pasted) string of base64-encoded data, again filtered
> with the Jinga2 b64decode filter, like this:
>
> user_data: "{{ '/Td6WFoAAATm1rRGA … VZiascRn+wIABFla' | b64decode }}"
>
> That took the file lookup plugin out of the equation, but resulted in the
> same error.
>
> I next tried the pipe lookup plugin (with ‘cat my-binary-file’), but that
> also fails in the same way as the file lookup plugin. Looking at the source
> code, the pipe lookup plugin follows the file lookup one and
> unconditionally tries to decode the output from the command as a UTF-8
> encoded string.
>
> I provisionally conclude from all this that Ansible generally doesn’t want
> to handle binary parameter values. That seems limiting. I suppose one
> solution to my specific problem (without fixing the wider issue) would be
> for the ec2 module to accept something like a user_data_file parameter (as
> an alternative to user_data), which would specify a local file whose
> content was to be used without any processing at all as an opaque user data
> binary object. In fact, that’s pretty much exactly what I want, as I could
> give it the FreeBSD configinit .tar file directly.
>
> I am still hoping that someone has a solution that will enable binary user
> data to be provided to an instance.
>
> Again, my thanks in advance for any assistance.
>
> --
> Daniel
>
> On Tuesday, 23 December 2014 23:06:38 UTC, Daniel Neades wrote:
>>
>> On Saturday, 25 October 2014 20:33:32 UTC+1, Chris Church wrote:
>>>
>>> The file lookup plugin is your friend.
>>>
>>
>> It is – if one wishes to supply text-based user data. Unfortunately, I
>> have a requirement to provide a binary blob of user data, and the file
>> lookup plugin does not seem to handle that – looking at the source code, it
>> expects the file to be a UTF8-encoded text file.
>>
>> 
>>
>  --
> 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/9708972a-8a15-4819-9837-4a172b9cf608%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/9708972a-8a15-4819-9837-4a172b9cf608%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 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/CAH%2BKTJ70gac9XHpGtf3OvmwB47RnDo1CNNe9yiO6wK%2BBi2TstA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Can core user module be extended?

2014-12-25 Thread Chris Church
There's already an open PR to support OS X:
https://github.com/ansible/ansible-modules-core/pull/66


On Mon, Dec 22, 2014 at 6:45 PM, Alan Ray  wrote:

> I'm looking to extend the core user module to work (at least partially)
> with OS X (Darwin). The nearest discussion I can find is about 18 months
> old (
> https://groups.google.com/forum/#!searchin/ansible-project/extend$20module/ansible-project/7SByPqJxa7Q/NVeOAWdAio4J)
> and is pretty negative about the possibility of extending a core module.
>
> However, I notice that core user module seems to have extensibility built
> in since it automatically selects the best class based on the
> platforms/distributions defined in the subclasses. Short of cut-n-pasting
> the whole user module (1500 lines of code), is there a way of just writing
> the OS X extension and having it be automatically loaded for OS X platforms?
>
> Thanks,
> Alan
>
> --
> 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/d80faeef-208c-445c-89e8-4ffe6b10f4a1%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/CAH%2BKTJ6N3hMWipJbxy9-a8-v-sgxJq%2Bhbur%3DZkvB5hqLW2CcHA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: How to get a server's identifier

2014-12-25 Thread Chris Church
Use set_fact to initially define the variable for each host, then you can
reference the variable name wherever you need it later:

- hosts: fooservers
  tasks:
- set_fact:
foo_var: "{% for pt in groups.fooservers %}{% if inventory_hostname
== pt %}foo{{ '%02d' % loop.index }}{% endif %}{% endfor %}"
- debug: var=foo_var



On Thu, Dec 25, 2014 at 8:59 PM,  wrote:

> Can you just use a host variable in your inventory and then reference that
> in your template?
>
> [fooservers]
> steve special_identifier=01
> larry special_identifier=02
> frank special_identifier=03
> eleanor special_identifier=04
>
> Jay
>
>
> On Wednesday, December 24, 2014 7:14:08 PM UTC-6, Bevan Bennett wrote:
>>
>> We have a lot of config that wants to fill in templates based on a
>> particular server's "number" within a certain group.
>>
>> For example, if we have an inventory file with:
>> [fooservers]
>> steve
>> larry
>> frank
>> eleanor
>>
>> ...we then want to configure steve's templates with "foo01", larry with
>> "foo02", frank with "foo03", etc.
>> In most cases I've been using the following pattern inside of templates:
>> {% for pt in groups.ptservers %}
>> {% if inventory_hostname == pt %}
>>  special_identifier = foo{{ '%02d' % loop.index }}
>> {% endif %}
>> {% endfor %}
>>
>>
>> This has worked well for limited use, but is there an easier way to store
>> the server's associated loop_index for reuse at either the playbook or
>> template level?
>> We have reached a point where we have a template that needs to use this
>> value 27 times, and I don't want to have to clutter everything up with 27
>> loops...
>>
>> I tried using {% set %} in the template inside of the loop. but set has
>> local scope, so it's unusable afterwards.
>>
>> Has anyone else come up with a good solution for this pattern or do I
>> just need to make a really really ugly template?
>>
>  --
> 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/57dcfa68-14e7-4c84-98d3-021236cc235d%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/CAH%2BKTJ5rJTQdBpck-T8RV94DYBpUv_YSB8ku-EiO6ob9oAdfdw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] django_manage module detailed explaination

2014-12-25 Thread Chris Church
To use with_items, replace app1 in your command with the variable {{item}}:

- django_manage: >
command="makemigrations --noinput {{item}}"
app_path={{app_path}}
settings={{django_settings}}
  with_items:
- app1
- app2
- app3


The createsuperuser command doesn't support setting a password from the
command line.  I've found a simple third-party app (
https://github.com/ActiveState/django-stackato) to add a management command
for changing a user's password, so after installing it you could run
something like:

- django_manage: >
command="createsuperuser --noinput --username=myuser --email=
myem...@xyz.com"
app_path={{app_path}}
settings={{django_settings}}
- django_manage: >
command="changepassword2 myuser mypassword"
app_path={{app_path}}
settings={{django_settings}}

The django_manage documentation does indicate that "Other commands can be
entered, but will fail if they're unknown to Django.", but it doesn't give
an example of running one that's not in the list of built-in commands.
I've submitted a fix (
https://github.com/ansible/ansible-modules-core/pull/574).



On Thu, Dec 25, 2014 at 10:59 AM, Eric sharma 
wrote:

> Thanks Chris
>
> Your solution for makemigrations command working perfect but I didn't find
> similar thing in docs. have I missed something?
> I've two more small queries.
> 1) how do I pass multiple app name in makemigrations command which is in a
> variable (I mean using ansible's *with_items*)
>
> - name: Django makemigrations
>   django_manage: command="makemigrations --noinput app1" app_path={{
> app_path}} settings={{django_settings}}
>
>   with_items:
>-  app1
>-  app2
>-  app3
>
> 2) how do I pass username and password in createsuperuser command?
> I run this task but it didn't work?
>
> - django_manage: command="createsuperuser --noinput myuser myem...@xyz.com
> mypassword" app_path={{app_path}} settings={{django_settings}}
>
>
> Thanks again for* --input* thing :)
>
>
>
>
>
>
>  --
> 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/089ceee9-7e65-4a22-834e-b2861284792b%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/CAH%2BKTJ7%3DGd4iMe6UTus%2BmJNuO0EQk_GLXubPR5tbkgZiHohQdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] django_manage module detailed explaination

2014-12-24 Thread Chris Church
The createsuperuser command doesn't support a command line option to set a
password; you can only set username and email when running with the
--noinput flag.  There are hackish workarounds for creating an initial
superuser with password (
http://source.mihelac.org/2009/10/23/django-avoiding-typing-password-for-superuser/),
but these wouldn't use the django_manage module.  Your other option would
be writing your own custom management command for creating superusers.

For running django management commands not specifically listed in the docs,
or to use custom command options, you can specify your command and options
as a single string, e.g.:

- django_manage: command="makemigrations --noinput app1"
app_path={{app_path}} settings={{django_settings}}




On Tue, Dec 23, 2014 at 6:13 AM, Eric sharma 
wrote:

> The module provide here
> http://docs.ansible.com/django_manage_module.html
> needs to have some more example for manage.py command.
>
> example: createsuperuser. How can we create superuser with a specific
> username and password? is there any way to pass this information in this
> module
>
>
> - name: Django Create Superuser
>   django_manage: command=createsuperuser
>  app_path={{app_path}}
>  settings={{django_settings}}
>   tags:
> - django
>
> and how do we use latest django'(1.7)'s makemigration command where we
> have to give app name (I mean
>  python manage.py makemigration app1
> )
>
> for same environment/path settings collectstatic command works perfectly
>
> - name: Django Collectstatic
>   django_manage: command=collectstatic
>  app_path={{app_path}}
>  settings={{django_settings}}
>
>
> Could somebody please provide example of these
>
> Thanks
>
> --
> 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/80ad9495-a9d4-43a1-a63b-10f08e465369%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/CAH%2BKTJ5bt%2BrPcRCCyFnMST_XtbdvB-3qgmFPtW5uZdNuXEkWMQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] script module for powershell

2014-12-22 Thread Chris Church
Verify that you're running a recent version of pywinrm (either
http://github.com/diyan/pywinrm/archive/master.zip#egg=pywinrm or the
latest from PyPI will work).  Earlier versions didn't correctly handle a
script taking longer than 60 seconds.

PowerShell scripts that encounter an error won't exit with a nonzero return
code by default (which is what normally indicates an error to Ansible).  A
script will need to use a try/catch block or trap block (e.g.
https://github.com/ansible/ansible/blob/devel/test/integration/roles/test_win_script/files/test_script_with_errors.ps1)
to exit appropriately in case of an error.  Otherwise, error messages will
be printed to stderr and ignored.

If you need to start another program and make sure the script waits for it
to finish, you may need to use Start-Process/Wait-Process instead of simply
running the command.


On Mon, Dec 22, 2014 at 6:27 PM, J Hawkesworth <
j.r.hawkeswo...@googlemail.com> wrote:

> The only time I have seen inconsistent behaviour similar to what you
> describe I was trying to control machines which were many network hops away
> from the controller.
> One thing to try would be to keep an eye on the windows event log on the
> remote machines.
>
> I guess it might be worth checking what kind of network speeds you are
> getting just in case you are working over a busy network.
>
> Hope that's some help.
>
> Jon
>
> --
> 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/29015c82-bf90-411e-b05a-83f8ab58733a%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/CAH%2BKTJ4dYoNKbSgs_Cxn8WZM3RTRSAKf3apsqY%3D%3D0GyP9y3qLA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to use ec2 modules user_data field?

2014-12-19 Thread Chris Church
I'm planning to get some of these roles onto Galaxy, but until then...

The next tasks in that particular play are:

- name: wait for instances to listen on port 5986 (winrm https)
  wait_for:
state=started
host={{ item.tagged_instances[0].public_ip }}
port=5986
  with_items: win_ec2.results
  when: win_ec2_images and win_ec2 is defined

- name: obtain windows passwords for instances
  ec2_win_pass:
aws_access_key: '{{ aws_access_key }}'
aws_secret_key: '{{ aws_secret_key }}'
region: '{{ win_ec2_region }}'
instance_id: "{{ item.tagged_instances[0].id }}"
private_key: "{{ lookup('file', win_ec2_private_key) }}"
  with_items: win_ec2.results
  register: win_ec2_passwords
  when: win_ec2_images and win_ec2 is defined

- name: add_host
  add_host:
name: '{{ item.item.tagged_instances[0].public_dns_name }}'
groups: 'cloud,ec2,windows,{{win_ec2_name_prefix}}-{{
item.item.item.name }}'
ansible_ssh_host: '{{ item.item.tagged_instances[0].public_ip }}'
ansible_ssh_port: 5986
ansible_ssh_user: '{{ item.item.item.user }}'
ansible_ssh_pass: '{{ item.password }}'
ansible_connection: 'winrm'
  with_items: win_ec2_passwords.results
  when: win_ec2_images and win_ec2_passwords is defined


The second task is using my module from
https://github.com/ansible/ansible-modules-core/pull/378

You can also save these new hosts to an inventory file (using template
module).

After the play above runs, I can then run another play to ping the
newly-launched Windows hosts:

- name: ping new windows instances
  hosts: windows
  gather_facts: false
  tasks:
- action: win_ping


Hope that helps!



On Thu, Dec 18, 2014 at 12:46 AM, Rob White  wrote:
>
> Hi Chris,
>
> What's your approach for logging in to your Win boxes using WinRM after
> this step?
>
> Ansible docs direct you to configure a vars file with ansible_ssh_pass set
> however every ec2 instance is going to have a different password.  I've
> created a module for using boto to get the ec2 password but i dont know how
> to chain this through to then use it for a following play which would
> configure my windows instances.
>
>
> On Sunday, 26 October 2014 06:33:32 UTC+11, Chris Church wrote:
>>
>> The file lookup plugin is your friend.
>>
>> I'm using the following task for launching Windows instances and
>> configuring PowerShell remoting:
>>
>> - ec2:
>> aws_access_key: '{{ aws_access_key }}'
>> aws_secret_key: '{{ aws_secret_key }}'
>> region: '{{ win_ec2_region }}'
>> instance_type: '{{ win_ec2_instance_type }}'
>> instance_tags:
>> Name: '{{win_ec2_name_prefix}}-{{item.name}}'
>> group: '{{ win_ec2_security_group }}'
>> key_name: '{{ win_ec2_key_name }}'
>> image: '{{ item.id }}'
>> user_data: "{{ lookup('file', 'win_ec2_user_data') }}"
>> exact_count: 1
>> count_tag:
>> Name: '{{win_ec2_name_prefix}}-{{item.name}}'
>> wait: yes
>>   with_items: win_ec2_images
>>   register: win_ec2
>>
>>
>> My win_ec2_user_data file contains:
>>
>> 
>> iex ((new-object net.webclient).DownloadString('https://raw.
>> githubusercontent.com/ansible/ansible/devel/examples/scripts/
>> ConfigureRemotingForAnsible.ps1'))
>> 
>>
>>
>>
>>
>> On Fri, Oct 24, 2014 at 8:00 PM, Michael DeHaan 
>> wrote:
>>
>>> I don't believe YAML takes Python-like docstrings.
>>>
>>> So you would need to start with a single or double quote and escape any
>>> internal quotes as need be.
>>>
>>> The "file" lookup plugin may also be helpful.
>>>
>>> On Fri, Oct 24, 2014 at 12:06 PM, Erick Barros 
>>> wrote:
>>>
>>>> I got the following error:
>>>>
>>>> ERROR: Syntax Error while loading YAML script, /etc/ansible/playbooks/
>>>> search/roles/aws/tasks/main.yml
>>>> Note: The error may actually appear before this position: line 13,
>>>> column 17
>>>>
>>>>
>>>>state: running
>>>>user_data: """#!/bin/bash
>>>> ^
>>>> This one looks easy to fix.  It seems that there is a value started
>>>> with a quote, and the YAML parser is expecting to see the line ended
>>>> with the same kind of quote.  For instance:
>>>>
>>>>
>>>>   

Re: [ansible-project] Re: ansible win_ping "WINRM RESULT "

2014-12-15 Thread Chris Church
This hotfix was previously mentioned on the list (
https://groups.google.com/d/topic/ansible-project/nve1NRr2Vx4/discussion)
as a fix for this problem:

https://support.microsoft.com/kb/2842230


On Mon, Dec 15, 2014 at 11:51 AM, youmarva  wrote:
>
> Thanks Jon for your reply, I will try to update windows and I inform you of
> the result.
>
> Le lundi 15 décembre 2014 17:35:17 UTC+1, J Hawkesworth a écrit :
>
>> I think I had this StackOverflowException  problem in the past with a
>> windows server 2008 installation which had not received any windows updates.
>> I suggest you check you are up to date with windows updates.
>> Jon
>>
>> On Monday, December 15, 2014 3:44:48 PM UTC, youmarva wrote:
>>>
>>> Hi,
>>>
>>> I have configured my server Ansible and my windows machines to use the
>>> windows modules, the connection is going well for most of the machines
>>> tested except for a few where I have the following error when i execute
>>> ansible
>>> #windows -m win_ping -
>>> ansible windows -m win_ping -
>>> <172.16.0.80> ESTABLISH WINRM CONNECTION FOR USER: infra on PORT 5986
>>> TO 172.16.0.80
>>> <172.16.0.80> WINRM CONNECT: transport=plaintext endpoint=https://
>>> 172.16.0.80:5986/wsman
>>> <172.16.0.80> REMOTE_MODULE win_ping
>>> <172.16.0.80> EXEC (New-Item -Type Directory -Path $env:temp -Name
>>> "ansible-tmp-141865.53-246551001925925").FullName | Write-Host -
>>> Separator '';
>>> <172.16.0.80> WINRM EXEC 'PowerShell' ['-NoProfile', '-NonInteractive',
>>> '-EncodedCommand', 'KABOAGUAdwAtAEkAdABlAG0AIAAtAF
>>> QAeQBwAGUAIABEAGkAcgBlAGMAdABvAHIAeQAgAC0AUABhAHQAaAAgACQAZQ
>>> BuAHYAOgB0AGUAbQBwACAALQBOAGEAbQBlACAAIgBhAG4AcwBpAGIAbABlAC
>>> 0AdABtAHAALQAxADQAMQA4ADYANQAzADMAMwAzAC4ANQAzAC0AMgA0ADYANQ
>>> A1ADEAMAAwADEAOQAyADUAOQAyADUAIgApAC4ARgB1AGwAbABOAGEAbQBlAC
>>> AAfAAgAFcAcgBpAHQAZQAtAEgAbwBzAHQAIAAtAFMAZQBwAGEAcgBhAHQAbw
>>> ByACAAJwAnADsA']
>>> <172.16.0.80> WINRM RESULT >> err "">
>>> <172.16.0.80> PUT /tmp/tmpfe1MUN TO C:\Users\infra\AppData\Local\Temp\
>>> ansible-tmp-141865.53-246551001925925\\win_ping
>>> <172.16.0.80> WINRM PUT /tmp/tmpfe1MUN to C:\Users\infra\AppData\Local\T
>>> emp\ansible-tmp-141865.53-246551001925925\\win_ping.ps1 (offset=0
>>> size=2037)
>>> <172.16.0.80> WINRM PUT /tmp/tmpfe1MUN to C:\Users\infra\AppData\Local\T
>>> emp\ansible-tmp-141865.53-246551001925925\\win_ping.ps1 (offset=2037
>>> size=2037)
>>> <172.16.0.80> WINRM PUT /tmp/tmpfe1MUN to C:\Users\infra\AppData\Local\T
>>> emp\ansible-tmp-141865.53-246551001925925\\win_ping.ps1 (offset=4074
>>> size=1807)
>>> <172.16.0.80> PUT /tmp/tmpMlMZ5d TO C:\Users\infra\AppData\Local\Temp\
>>> ansible-tmp-141865.53-246551001925925\\arguments
>>> <172.16.0.80> WINRM PUT /tmp/tmpMlMZ5d to C:\Users\infra\AppData\Local\T
>>> emp\ansible-tmp-141865.53-246551001925925\\arguments (offset=0 size=
>>> 2)
>>> <172.16.0.80> EXEC PowerShell -NoProfile -NonInteractive -
>>> ExecutionPolicy Unrestricted -File "C:\Users\infra\AppData\Local\
>>> Temp\ansible-tmp-141865.53-246551001925925\\win_ping.ps1"
>>> "C:\Users\infra\AppData\Local\Temp\ansible-tmp-141865.
>>> 53-246551001925925\\arguments"; Remove-Item
>>> "C:\Users\infra\AppData\Local\Temp\ansible-tmp-141865.53-246551001925925\"
>>> -Force -Recurse;
>>> <172.16.0.80> WINRM EXEC 'PowerShell' ['-NoProfile', '-NonInteractive',
>>> '-EncodedCommand', 'UABvAHcAZQByAFMAaABlAGwAbAAgAC
>>> 0ATgBvAFAAcgBvAGYAaQBsAGUAIAAtAE4AbwBuAEkAbgB0AGUAcgBhAGMAdA
>>> BpAHYAZQAgAC0ARQB4AGUAYwB1AHQAaQBvAG4AUABvAGwAaQBjAHkAIABVAG
>>> 4AcgBlAHMAdAByAGkAYwB0AGUAZAAgAC0ARgBpAGwAZQAgACIAQwA6AFwAVQ
>>> BzAGUAcgBzAFwAaQBuAGYAcgBhAFwAQQBwAHAARABhAHQAYQBcAEwAbwBjAG
>>> EAbABcAFQAZQBtAHAAXABhAG4AcwBpAGIAbABlAC0AdABtAHAALQAxADQAMQ
>>> A4ADYANQAzADMAMwAzAC4ANQAzAC0AMgA0ADYANQA1ADEAMAAwADEAOQAyAD
>>> UAOQAyADUAXABcAHcAaQBuAF8AcABpAG4AZwAuAHAAcwAxACIAIAAiAEMAOg
>>> BcAFUAcwBlAHIAcwBcAGkAbgBmAHIAYQBcAEEAcABwAEQAYQB0AGEAXABMAG
>>> 8AYwBhAGwAXABUAGUAbQBwAFwAYQBuAHMAaQBiAGwAZQAtAHQAbQBwAC0AMQ
>>> A0ADEAOAA2ADUAMwAzADMAMwAuADUAMwAtADIANAA2ADUANQAxADAAMAAxAD
>>> kAMgA1ADkAMgA1AFwAXABhAHIAZwB1AG0AZQBuAHQAcwAiADsAIABSAGUAbQ
>>> BvAHYAZQAtAEkAdABlAG0AIAAiAEMAOgBcAFUAcwBlAHIAcwBcAGkAbgBmAH
>>> IAYQBcAEEAcABwAEQAYQB0AGEAXABMAG8AYwBhAGwAXABUAGUAbQBwAFwAYQ
>>> BuAHMAaQBiAGwAZQAtAHQAbQBwAC0AMQA0ADEAOAA2ADUAMwAzADMAMwAuAD
>>> UAMwAtADIANAA2ADUANQAxADAAMAAxADkAMgA1ADkAMgA1AFwAIgAgAC0ARg
>>> BvAHIAYwBlACAALQBSAGUAYwB1AHIAcwBlADsA']
>>> <172.16.0.80> WINRM RESULT >> : ">
>>> pc-bill | FAILED >> {
>>> "failed": true,
>>> "msg": "ConvertTo-Json : \r\n",
>>> "parsed": false
>>> }
>>>
>>> or
>>>
>>> <172.16.0.80> WINRM RESULT >> : Une">
>>> pc-bill | 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 579, 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__.

Re: [ansible-project] Re: win_chocolatey not a legal parameter

2014-12-14 Thread Chris Church
If you run the same command with -v (5 v's), you'll get everything sent
back on stderr instead of just "Starting t".  There may be something in
that output to provide more details on what went wrong.


On Fri, Dec 12, 2014 at 2:35 AM, Ashley(Yanan) Yuan <11027...@liferay.com>
wrote:
>
> Hello guys,
>
> I'm new to ansible. And I'm using ansible 1.9 to install apps to my
> windows machine. But i've always run into this problem when using the
> following command:
>
> ansible windows -m win_chocolatey -c winrm -u Administrator -a
> 'package=notepadplusplus' --ask-vault-pass -
>
> error messages:
>
>  WINRM RESULT > "Starting t">
>> ide-qa-3-pc | FAILED >> {
>> "changed": false,
>> "chocolatey command": "choco.exe install notepadplusplus -source
>> https://chocolatey.org/api/v2/";,
>> "failed": true,
>> "msg": "Install error: "
>> }
>
>
> I've run into the same error when I run ansible-playbook. By the way, I
> could using win_ping to connect my windows host and run win_msi to install
> apps successfully.
>
> Why win_chocolatey failed? I'm really appreciate to any of your
> suggestions.
>
> 在 2014年12月8日星期一UTC+8下午1时47分30秒,Rob White写道:
>
>> I'm having trouble with win_chocolatey module in a playbook.
>>
>> I upgraded from 1.7 to 1.9 and then ran the following successfully:
>>
>> ansible windows -i inventories/windows -m win_chocolatey -c winrm -u
>>> administrator -k -a 'package=notepadplusplus'
>>> SSH password:
>>> 1.2.3.4 | success >> {
>>> "changed": true,
>>> "chocolatey command": "C:\\ProgramData\\chocolatey\\bin\\choco.exe
>>> install notepadplusplus -source https://chocolatey.org/api/v2/";,
>>> "chocolatey_success": "true"
>>
>> }
>>
>>
>> So then I added to a playbook as per the documentation but I get the
>> following error:
>>
>> ansible-playbook hosts_windows.yml -i inventories/windows
>>> ERROR: win_chocolatey is not a legal parameter in an Ansible task or
>>> handler
>>
>>
>> Why would ansible see the module, but ansible-playbook fail?
>>
>  --
> 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/abcd960d-cdfb-4deb-b9a7-5a7f3980eadf%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/CAH%2BKTJ5OqJGrNNzCG6JZN94K2zJJZQv9n%2BsLt7wdCT1fLPH0JA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible + vpshere_guest

2014-12-14 Thread Chris Church
The Python version installed on ESX doesn't include all the "standard"
library code needed to run Ansible modules.  You're pretty much limited to
using *raw* and *script* to do anything over SSH.

You may want to set *gather_facts: false* in your play to prevent trying to
run the *setup* module.

The *vsphere_guest* module is meant to be run on the control machine, using
*local_action* or *delegate_to*.  The following play shows an example of
connecting to an ESXi server using both SSH and PySphere:


- hosts: vmware
  gather_facts: false
  tasks:
- raw: uname -a
- vsphere_guest:
vcenter_hostname: "{{ ansible_ssh_host|default(inventory_hostname)
}}"
username: "{{ hostvars[inventory_hostname].ansible_ssh_user|quote
}}"
password: "{{ hostvars[inventory_hostname].ansible_ssh_pass|quote
}}"
guest: "My Guest"
vmware_guest_facts: yes
  delegate_to: localhost



On Sun, Dec 14, 2014 at 1:56 PM,  wrote:
>
> Hello all,
>
> I'm starting with Ansible, and I would like to provsion a VMWare Cluster
> with it.
> To do that, I use the vsphere-guest module. However, I try to use it!
>
> So I create a role /etc/ansible/role/esx/task/main.yml and try to set up a
> VM.
> I follow the the official documentetion:
> http://docs.ansible.com/vsphere_guest_module.html
>
> But when I try to run my playbook, it doesn't work.
> I've this error:
>
> shell> ansible-playbook -i /etc/ansible/hosts /etc/ansible/base.yml -C
> GATHERING FACTS
> ***
> failed: [ip_of_esx] => {"failed": true, "parsed": false}
> Traceback (most recent call last):
>   File "//.ansible/tmp/ansible-tmp-1418582864.23-9976934275/setup",
> line 204, in 
> import grp
> ImportError: No module named grp
>
> And I don't find anything about this error, and I don't know how to solve
> it...
>
> pysphere in lastest version is install (easy_install -U pysphere)
> I try this command: ansible esx -m raw -a "date"
> It works fine.
>
> Somebody already try this module? Maybe I don't use it well...
>
> Thanks a lot.
>
>  --
> 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/6dcb33d0-653d-4613-a990-bfb6ea936f3b%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/CAH%2BKTJ5pSZtkbgOcF3DBDVVfAT1WCzWd%3DkEDXAq1W0hBDc4Ozg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Problem in exuting ConfigureRemotingForAnsible.ps1 in windows 7

2014-12-09 Thread Chris Church
That error is coming from the attempt to connect back to localhost.  'd
made changes to some of the error handling recently; previously the script
would write an error message but continue to run.

Try commenting out line 135 (
https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1#L135)
to let the script continue past the error: Throw "Unable to establish an
HTTP or HTTPS remoting session."

Please let me know if that change works for you.


On Tue, Dec 9, 2014 at 6:44 AM, youmarva  wrote:

> I want to exécute  in a windows 7 machine to allow connexion with Ansible.
>
> In some Machines I have this error when executing
> ConfigureRemotingForAnsible.ps1 (as admin) :
>
> PS C:\Users\adminsifast\Documents\Ansible>
> .\ConfigureRemotingForAnsible.ps1
>
> WinRM has been updated to receive requests.
> The type of the WinRM service was successfully modified.
>
>
> *or (**WinRM is already configured to receive this request**)*
>
> C:\Users\adminsifast\Documents\Ansible\ConfigureRemotingForAnsible.ps1 :
> Could not establish session on either HTTP or
> HTTPS. Breaking
> Au caractère Ligne:1 : 1
> + .\ConfigureRemotingForAnsible.ps1
> + ~
> + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
> + FullyQualifiedErrorId :
> Microsoft.PowerShell.Commands.WriteErrorException,ConfigureRemotingForAnsible.ps1
>
>
> I searched this error but I have not find a solution to it.
> for some pc when I execute ConfigureRemotingForAnsible.ps1 I have no
> problem but on the other the proplem persists.
>
> if you have an idea thank you to orient me, I really need a solution to
> communicate with Ansible.
>
> thank you
>
>  --
> 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/cb6bbb28-bc6c-4485-b3de-8d2b67376768%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/CAH%2BKTJ6Ht3AE4RhPAZ8e5wtccD%2BDZ5vr9z5W_SpYoTA0n9hWUw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] win_chocolatey not a legal parameter

2014-12-08 Thread Chris Church
Trying using ansible-playbook with -c winrm, or add
ansible_connection=winrm to your inventory for Windows hosts.

Ansible will only find PowerShell modules when using the winrm connection.


On Mon, Dec 8, 2014 at 9:40 PM, Rob White  wrote:

> # Install common packages
> - name: Install common packages from chocolatey
>   win_chocolatey:
> package: notepadplusplus
> state: present
> showlog: true
>
> On Tuesday, 9 December 2014 11:26:17 UTC+11, Chris Church wrote:
>>
>> Could you paste the task from your playbook that's causing the error?
>>
>>
>> On Mon, Dec 8, 2014 at 12:47 AM, Rob White  wrote:
>>
>>> I'm having trouble with win_chocolatey module in a playbook.
>>>
>>> I upgraded from 1.7 to 1.9 and then ran the following successfully:
>>>
>>> ansible windows -i inventories/windows -m win_chocolatey -c winrm -u
>>>> administrator -k -a 'package=notepadplusplus'
>>>> SSH password:
>>>> 1.2.3.4 | success >> {
>>>> "changed": true,
>>>> "chocolatey command": "C:\\ProgramData\\chocolatey\\bin\\choco.exe
>>>> install notepadplusplus -source https://chocolatey.org/api/v2/";,
>>>> "chocolatey_success": "true"
>>>
>>> }
>>>
>>>
>>> So then I added to a playbook as per the documentation but I get the
>>> following error:
>>>
>>> ansible-playbook hosts_windows.yml -i inventories/windows
>>>> ERROR: win_chocolatey is not a legal parameter in an Ansible task or
>>>> handler
>>>
>>>
>>> Why would ansible see the module, but ansible-playbook fail?
>>>
>>> --
>>> 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-proje...@googlegroups.com.
>>> To post to this group, send email to ansible...@googlegroups.com.
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/ansible-project/ca1815cc-565f-4bd7-8492-
>>> 897dc382b66a%40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/ca1815cc-565f-4bd7-8492-897dc382b66a%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 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/fff1cfe4-3eb1-4e16-ab07-f688e6c6d17f%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/fff1cfe4-3eb1-4e16-ab07-f688e6c6d17f%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 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/CAH%2BKTJ4CN459f-VLGMcNwVqpDgsPJeHXHzV%2BMuaR%2BJZB5%2BTn7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] win_chocolatey not a legal parameter

2014-12-08 Thread Chris Church
Could you paste the task from your playbook that's causing the error?


On Mon, Dec 8, 2014 at 12:47 AM, Rob White  wrote:

> I'm having trouble with win_chocolatey module in a playbook.
>
> I upgraded from 1.7 to 1.9 and then ran the following successfully:
>
> ansible windows -i inventories/windows -m win_chocolatey -c winrm -u
>> administrator -k -a 'package=notepadplusplus'
>> SSH password:
>> 1.2.3.4 | success >> {
>> "changed": true,
>> "chocolatey command": "C:\\ProgramData\\chocolatey\\bin\\choco.exe
>> install notepadplusplus -source https://chocolatey.org/api/v2/";,
>> "chocolatey_success": "true"
>
> }
>
>
> So then I added to a playbook as per the documentation but I get the
> following error:
>
> ansible-playbook hosts_windows.yml -i inventories/windows
>> ERROR: win_chocolatey is not a legal parameter in an Ansible task or
>> handler
>
>
> Why would ansible see the module, but ansible-playbook fail?
>
> --
> 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/ca1815cc-565f-4bd7-8492-897dc382b66a%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/CAH%2BKTJ4n%2Bz7UEb76cjBZeYE74VypCXEny3Uo8BLhPNBhi6Qnow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Windows Support Stage 2: Engage Battlestations!

2014-12-01 Thread Chris Church
Hi Glenn,

Thanks for the feedback.  The use cases you've indicated help us to
determine what Windows users need.

First of all, Windows modules are written in PowerShell, so there's no need
to learn Python to contribute in that area.

We do support dropping to PowerShell if you have existing scripts you'd
like to use, or there's not yet a module to do what you want. The raw
module (http://docs.ansible.com/raw_module.html) allows for running simple
commands directly, while the script module (
http://docs.ansible.com/script_module.html) can be used to run most any
PowerShell script.  The integration tests may offer you some good examples
for using those modules and checking the results (
https://github.com/ansible/ansible/blob/devel/test/integration/roles/test_win_raw/tasks/main.yml
and
https://github.com/ansible/ansible/blob/devel/test/integration/roles/test_win_script/tasks/main.yml
).

Basic MSI installs are supported via the win_msi module (
http://docs.ansible.com/win_msi_module.html).  There was also some work
done on a more capable win_package module, which may be revisited in the
future (https://github.com/ansible/ansible/pull/8860), as well as support
for using the chocolatey package manager (
https://github.com/ansible/ansible-modules-extras/pull/37).

File management support has recently been submitted (
https://github.com/ansible/ansible/pull/9611 and
https://github.com/ansible/ansible-modules-core/pull/384).

User management is supported via the win_user module (
http://docs.ansible.com/win_user_module.html), and I have some pending
updates for that one as well (
https://github.com/ansible/ansible-modules-core/pull/84).

The win_feature module (http://docs.ansible.com/win_feature_module.html)
should at least allow you to get IIS and other built-in roles/features
working, but we don't yet have any support for IIS config.



On Tue, Nov 25, 2014 at 10:53 AM, Glenn  wrote:

> I'm in a Windows IIS shop that is trying to convert from using a using a
> VM master image that is continually updated to a bare OS install starting
> point.  There is a lot of manual playbooking and simple scripting
> currently.  We are implementing a more robust system for configuration
> management.  Ansible is being shot down as a option to use for
> configuration management and orchestration because it is too immature on
> the Windows side compared to Chef or Puppet.  The view of simpler concepts
> and setup with no agent was trumped by existing code and market share.  The
> killer features that would make Ansible viable for us are msi and exe
> installs, file managment, user management, WMI and registry edits, granular
> IIS and SQL configuration modules.  There isn't an appetite here to learn
> Python and write the Ansible modules to make it mature enough for our use.
> Since The other options also allow dropping to Powershell to execute code,
> there wasn't much else I could offer for arguments for Ansible.
>
>
> On Thursday, July 31, 2014 2:42:35 PM UTC-5, Damon Overboe wrote:
>>
>> And the point that I try to make is I would rather be able to take a
>> clean VM with the absolute bare minimums and use that as a starting point,
>> rather than configuring a base VM image and then just pushing updates to
>> it.
>>
>> I may not have a lot of people on the Windows side that agree with that
>> right now, but I know there are people that do agree, and I think we'll see
>> more and more of them. I have met people that use Puppet seem to take the
>> same approach.
>>
>> To me, the cleanest starting point you can get helps ensure a solid yet
>> flexible install / upgrade plan, whereas starting with a heavily configured
>> or set up starting point just feels fragile to me, and it also makes it
>> harder to support newer versions of Windows, because you have to go back
>> through the entire process on each new version.
>>
>> On Thursday, July 31, 2014 1:40:51 PM UTC-5, Damon Overboe wrote:
>>>
>>> I wonder if the automation group is going to stay as spinning up VMs
>>> from manually configured starting points?
>>>
>>> I'm coming from the development side; I've traditionally been in the
>>> .net stack but as there is so much bleed-over between the different
>>> disciplines now, I feel like we're finally starting to get excellent
>>> glimpses into what continuous delivery *should* be, although I know
>>> that can be subjective as well.
>>>
>>> But I have a client that does everything manually, and I mean
>>> everything! I'm putting something in place on the development / testing
>>> side to start, and trying to pick that off a piece at a time to improve it.
>>> I've seen this at a lot of Windows / .net shops too; they all are extremely
>>> immature in their abilities to install / update a product.
>>>
>>> On Thursday, July 31, 2014 10:51:24 AM UTC-5, Steffen Prince wrote:

 I see there being three very different user groups for this:
  - *nix admins who for whatever reason have some services in their herd
 that are

Re: [ansible-project] Re: benefit of Dynamic Inventory over static inventory

2014-12-01 Thread Chris Church
I've made some VMware inventory updates that will become a PR once I get
tags working.  It includes a change to define ansible_ssh_host for running
VMs.

You can give it a try from my branch in the meantime:

https://github.com/cchurch/ansible/blob/vmware_inventory_improvements/plugins/inventory/vmware.py


On Sun, Nov 30, 2014 at 1:10 PM, Brian Coca  wrote:

> there is actually an existing inventory script for vmware/vcenter, in
> the repo at plugins/inventory/vmware.py, check your ansible
> installation for the file and set it up as your inventory. You can
> also copy the vmware.ini in the same directory as an example for
> setting it up.
>
>
> --
> Brian Coca
>
> --
> 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/CAJ5XC8%3DajEjGm0MPR6MGwAn-10gcQQ_FNFt%3DFsT7sbYU5oeFYw%40mail.gmail.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/CAH%2BKTJ4Ytm5Z10D4weBqb4rb6Z%3DTdoASOBY3zT5%2BiG4hOYuMTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] tag_Name issue with ec2.py

2014-11-13 Thread Chris Church
There is an open PR for using tags as names:
https://github.com/ansible/ansible/pull/7601

Until this one is merged, you could try applying those changes to your copy
of ec2.py.


On Mon, Nov 10, 2014 at 12:14 PM,  wrote:

> Thanks for the reply. I wasn't able to update this earlier as the post was
> being moderated. I was trying to figure out how to group my instances like
> you would with the standard /etc/ansible/hosts but after RTFM'ing further I
> discovered I could group them by adding a tag named class and calling those
> in my playbooks with tag_class_groupname. I started another post with a
> similar question about how to display tag_Name during the playbook runs but
> I'll wait for that post to be approved and update that one as well.
>
> Now I would like to figure out how to
>
> On Monday, November 10, 2014 9:25:55 AM UTC-6, Michael Peters wrote:
>>
>> This is because tags are not properties on the instance objects. I do
>> agree that it's weird that you can only pick properties of the
>> underlying python object for the destination variable.
>> The list of those properties is available here:
>> http://docs.pythonboto.org/en/latest/ref/ec2.html#module-
>> boto.ec2.instance
>>
>> I think it could be improved if instance it waited until all the data
>> was gathered and then allowed you to pick anything that was a property
>> in the json hash instead.
>>
>> On Sat, Nov 8, 2014 at 8:59 PM,   wrote:
>> > Hi all. I am running into an issue and I am having trouble figuring out
>> the
>> > problem.
>> >
>> > I am trying to set up Ansible with the ec2.py script replacing
>> > /etc/ansible/hosts with ec2.py and I am attempting to list my instances
>> with
>> > tag_Name.
>> >
>> > I am running Ansible inside an Amazon VPC so I have the following
>> settings
>> > in ec2.ini
>> >
>> > destination_variable = private_dns_name
>> > vpc_destination_variable = private_ip_address
>> >
>> > When I run ec2.py --list it works:
>> >
>> > : ./ec2.py --list
>> > {
>> >   "_meta": {
>> > "hostvars": {
>> >   "10.30.15.0": {
>> > "ec2__in_monitoring_element": false,
>> > "ec2_ami_launch_index": "0",
>> >
>> > If I change vpc_destination_variable to other things like id or
>> image_id it
>> > works. But if I set it to tag_Name I get the following error:
>> >
>> > AttributeError: 'Instance' object has no attribute 'tag_Name'
>> >
>> > I see tag_Name as an attribute when I do ec2.py --host HOST
>> >
>> > What am I missing here? I am using Ansible 1.7.2
>> >
>> > Thanks!
>> >
>> > --
>> > 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-proje...@googlegroups.com.
>> > To post to this group, send email to ansible...@googlegroups.com.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msgid/ansible-project/
>> 6c39f599-3659-419e-a951-5e37cc562c6a%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/6132b1bf-9efe-4b4f-b23f-8bc74568f8cd%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/CAH%2BKTJ5zpeoR8FbopBnQFBO-_cBPgsPVbHOYSARGu-FbAXsTYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible quoting

2014-11-06 Thread Chris Church
Absolutely, just haven't had a chance to get back to Windows-related things
this week.

On Thu, Nov 6, 2014 at 4:37 PM, Michael Perzel 
wrote:

> Are you going to submit a pull request for this into devel? It definitely
> solved my issue.
>
> On Saturday, October 25, 2014 2:23:55 PM UTC-5, Chris Church wrote:
>>
>> Could you create a gist (https://gist.github.com/) with the relevant
>> lines from your inventory variables, playbook and script (removing any
>> sensitive information)?  I'm not quite able to piece together a full
>> example of what you're running from the email thread.
>>
>> My branch is based on devel; I just created another branch based on 1.7.2
>> with the splatting changes applied: https://github.com/
>> cchurch/ansible/tree/powershell_splatting_v172
>> <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fcchurch%2Fansible%2Ftree%2Fpowershell_splatting_v172&sa=D&sntz=1&usg=AFQjCNELYa0RJWKIxEmXb2bqZVp5y1NogA>
>>
>>
>>
>>
>> On Fri, Oct 24, 2014 at 6:12 PM, Michael Perzel 
>> wrote:
>>
>>> I tried taking your changes but it failed with:
>>> http://schemas.
>>> microsoft.com/powershell/2004/04">C:\Users\ansible\
>>> AppData\Local\Temp\ansible-tmp-1414187414.25-97343749557638\de_x000D__x000A_>> S="Error">ployLauncher.ps1 : A positional parameter cannot be found that
>>> accepts _x000D__x000A_argument
>>> 'False'._x000D__x000A_At line:1 char:1_x000D__x000A_>> S="Error">+ & _x000D__x000A_C:\Users\ansible\
>>> AppData\Local\Temp\ansible-tmp-1414187414.25-97343749557638\\
>>> _x000D__x000A_..._x000D__x000A_+
>>> 
>>> ~_x000D__x000A_~~~_x000D__x000A_>> S="Error"> + CategoryInfo : InvalidArgument: (:) [deployLauncher.ps1],
>>> Param _x000D__x000A_ 
>>> eterBindingException_x000D__x000A_>> S="Error"> + FullyQualifiedErrorId : PositionalParameterNotFound,
>>> deployLauncher.ps1_x000D__x000A_
>>> _x000D__x000A_
>>>
>>> Looking at the diff between your code and mine there's a few other
>>> differences. I'm running 1.7.2,  I assume your branched off something
>>> newer.I'll see if I can sort through the issue.
>>>
>>> Thanks
>>>
>>> On Friday, October 24, 2014 3:52:39 PM UTC-5, Michael Perzel wrote:
>>>>
>>>> Your idea with jinja filter is what I originally tried to get working.
>>>> I never managed it but I think its the ideal solution (converting yaml hash
>>>> to a powershell one).
>>>>
>>>> If I follow your patch you added a parameter that controls whether or
>>>> not arguments get quoted (and set it to false for powershell scripts)? I'm
>>>> not particularly worried about nefarious activity within our system so this
>>>> could work for us.
>>>>
>>>> On Friday, October 24, 2014 12:52:52 AM UTC-5, Chris Church wrote:
>>>>>
>>>>> That method of passing arguments is apparently called "splatting" (
>>>>> http://technet.microsoft.com/en-us/magazine/gg675931.aspx).
>>>>>
>>>>> I have a branch where I've been able to get it working:
>>>>>
>>>>> https://github.com/cchurch/ansible/tree/powershell_splatting
>>>>>
>>>>>
>>>>> I've also added integration tests to show examples of it in use:
>>>>>
>>>>> https://github.com/cchurch/ansible/blob/powershell_splatting
>>>>> /test/integration/roles/test_win_script/tasks/main.yml#L50
>>>>>
>>>>>
>>>>> I also considered the idea of a Jinja2 filter to convert a YAML/JSON
>>>>> data structure to this format to allow for defining your arguments as you
>>>>> would any other variables:
>>>>>
>>>>> build_args:
>>>>>
>>>>>   key1: value1
>>>>>
>>>>>   key2: value2
>>>>>
>>>>>
>>>>> You could then run your task as:
>>>>>
>>>>> script: dostuff.ps1 {{ build_args|splattify }}
>>>>>
>>>>>
>>>>> Would you (or any other Windows users) be interested in this approach?
>>>>>
>>>>>
>>>>> On Wed, Oct 22, 2014 at 10:28 AM, Michael Perzel 
>>>>> wrote:
>>>>&g

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] How to use ec2 modules user_data field?

2014-10-25 Thread Chris Church
The file lookup plugin is your friend.

I'm using the following task for launching Windows instances and
configuring PowerShell remoting:

- ec2:
aws_access_key: '{{ aws_access_key }}'
aws_secret_key: '{{ aws_secret_key }}'
region: '{{ win_ec2_region }}'
instance_type: '{{ win_ec2_instance_type }}'
instance_tags:
Name: '{{win_ec2_name_prefix}}-{{item.name}}'
group: '{{ win_ec2_security_group }}'
key_name: '{{ win_ec2_key_name }}'
image: '{{ item.id }}'
user_data: "{{ lookup('file', 'win_ec2_user_data') }}"
exact_count: 1
count_tag:
Name: '{{win_ec2_name_prefix}}-{{item.name}}'
wait: yes
  with_items: win_ec2_images
  register: win_ec2


My win_ec2_user_data file contains:


iex ((new-object net.webclient).DownloadString('
https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1'
))





On Fri, Oct 24, 2014 at 8:00 PM, Michael DeHaan  wrote:

> I don't believe YAML takes Python-like docstrings.
>
> So you would need to start with a single or double quote and escape any
> internal quotes as need be.
>
> The "file" lookup plugin may also be helpful.
>
> On Fri, Oct 24, 2014 at 12:06 PM, Erick Barros 
> wrote:
>
>> I got the following error:
>>
>> ERROR: Syntax Error while loading YAML script, /etc/ansible/playbooks/
>> search/roles/aws/tasks/main.yml
>> Note: The error may actually appear before this position: line 13,
>> column 17
>>
>>
>>state: running
>>user_data: """#!/bin/bash
>> ^
>> This one looks easy to fix.  It seems that there is a value started
>> with a quote, and the YAML parser is expecting to see the line ended
>> with the same kind of quote.  For instance:
>>
>>
>> when: "ok" in result.stdout
>>
>>
>> Could be written as:
>>
>>
>>when: '"ok" in result.stdout'
>>
>>
>> or equivalently:
>>
>>
>>when: "'ok' in result.stdout"
>>
>>
>>
>>
>>
>>
>> On Saturday, August 16, 2014 12:04:59 PM UTC-3, Michael DeHaan wrote:
>>>
>>> (a)  can you please show the line from your playbook where you are using
>>> the user data variable?
>>>
>>> (b)  with the above, how are you determining the way it fails?  I.e.
>>> what does failure look like?
>>>
>>>
>>> On Fri, Aug 15, 2014 at 5:36 PM, Jonathan Nakatsui 
>>> wrote:
>>>
 From the ansible docs the ec2 module (http://docs.ansible.com/ec2_
 module.html) mentions a user_data field. However, there is no example
 showing the use of user_data.

 I've tried a variety of things to pass through to the user field to no
 avail including

 user_data: file.txt

 user_data: "{{ lookup('file', file.txt') }}"

 user_data: """#!/bin/bash
   apt-get update
   apt-get install htop"""

 And variations thereof. My googlefu has failed me so far to find any
 results for how to solve this issue.

 Thanks if you have any input.

 --
 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-proje...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/64b86c47-036a-471f-8a64-
 9cbd38c04f5c%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/a1c6540e-6ece-49b8-84f8-83802cb97ebb%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%2BnsWgyG79kBFTw3O_i62_FTd7MeBtuvLWUNnEauFLfNkQw66w%40mail.gmail.com
> 

Re: [ansible-project] Using Ansible with remote nodes running Windows 7

2014-10-25 Thread Chris Church
It seems like there may be a firewall/config issue preventing you from
connecting.  Can you try the following using curl?

curl -vk -d "" -u "user:pass" "https://host:5986/wsman";


You should get a 411 status code if the connection and authentication
worked as expected.


On Fri, Oct 24, 2014 at 2:05 PM, skinnedknuckles <
andersonjonatha...@gmail.com> wrote:

> Has anyone succeeded at running ansible with a remote node running Windows
> 7?  I'm having problems getting win-ping to work in this configuration.
> I've tried Fedora 20 and CentOs7 with Ansible 1.8.  My inventory and
> windows.yml files are good and I've run
>
> pip install http://github.com/diyan/pywinrm/archive/master.zip#egg=pywinrm
>
> Here is my debug output.
>
> [ansmgr@localhost ansible]$ ansible windows -c winrm -m win_ping
> --ask-pass -
> SSH password:
> <123.123.123.123> ESTABLISH WINRM CONNECTION FOR USER: ansmgr 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 559, in
> _executor
> exec_rc = self._executor_internal(host, new_stdin)
>   File "/etc/ansible/lib/ansible/runner/__init__.py", line 732, 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 895, 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
>
>  --
> 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/6e7dd49d-d56b-4f2e-8254-9ab0fd2a96f8%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/CAH%2BKTJ60aCsvZ73se6i%3D4a1C2EQkbabUgt9tvkSmRBWqBf2POw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible quoting

2014-10-25 Thread Chris Church
Could you create a gist (https://gist.github.com/) with the relevant lines
from your inventory variables, playbook and script (removing any sensitive
information)?  I'm not quite able to piece together a full example of what
you're running from the email thread.

My branch is based on devel; I just created another branch based on 1.7.2
with the splatting changes applied:
https://github.com/cchurch/ansible/tree/powershell_splatting_v172




On Fri, Oct 24, 2014 at 6:12 PM, Michael Perzel 
wrote:

> I tried taking your changes but it failed with:
> http://schemas.microsoft.com/powershell/2004/04";> S="Error">C:\Users\ansible\AppData\Local\Temp\ansible-tmp-1414187414.25-97343749557638\de_x000D__x000A_ S="Error">ployLauncher.ps1 : A positional parameter cannot be found that
> accepts _x000D__x000A_argument
> 'False'._x000D__x000A_At line:1 char:1_x000D__x000A_ S="Error">+ & _x000D__x000A_ S="Error">C:\Users\ansible\AppData\Local\Temp\ansible-tmp-1414187414.25-97343749557638\\
> _x000D__x000A_..._x000D__x000A_+
> ~_x000D__x000A_ S="Error">~~~_x000D__x000A_ + CategoryInfo :
> InvalidArgument: (:) [deployLauncher.ps1], Param _x000D__x000A_ S="Error"> eterBindingException_x000D__x000A_ +
> FullyQualifiedErrorId :
> PositionalParameterNotFound,deployLauncher.ps1_x000D__x000A_ S="Error"> _x000D__x000A_
>
> Looking at the diff between your code and mine there's a few other
> differences. I'm running 1.7.2,  I assume your branched off something
> newer.I'll see if I can sort through the issue.
>
> Thanks
>
> On Friday, October 24, 2014 3:52:39 PM UTC-5, Michael Perzel wrote:
>>
>> Your idea with jinja filter is what I originally tried to get working. I
>> never managed it but I think its the ideal solution (converting yaml hash
>> to a powershell one).
>>
>> If I follow your patch you added a parameter that controls whether or not
>> arguments get quoted (and set it to false for powershell scripts)? I'm not
>> particularly worried about nefarious activity within our system so this
>> could work for us.
>>
>> On Friday, October 24, 2014 12:52:52 AM UTC-5, Chris Church wrote:
>>>
>>> That method of passing arguments is apparently called "splatting" (
>>> http://technet.microsoft.com/en-us/magazine/gg675931.aspx).
>>>
>>> I have a branch where I've been able to get it working:
>>>
>>> https://github.com/cchurch/ansible/tree/powershell_splatting
>>>
>>>
>>> I've also added integration tests to show examples of it in use:
>>>
>>> https://github.com/cchurch/ansible/blob/powershell_
>>> splatting/test/integration/roles/test_win_script/tasks/main.yml#L50
>>>
>>>
>>> I also considered the idea of a Jinja2 filter to convert a YAML/JSON
>>> data structure to this format to allow for defining your arguments as you
>>> would any other variables:
>>>
>>> build_args:
>>>
>>>   key1: value1
>>>
>>>   key2: value2
>>>
>>>
>>> You could then run your task as:
>>>
>>> script: dostuff.ps1 {{ build_args|splattify }}
>>>
>>>
>>> Would you (or any other Windows users) be interested in this approach?
>>>
>>>
>>> On Wed, Oct 22, 2014 at 10:28 AM, Michael Perzel 
>>> wrote:
>>>
>>>> I'll look into this. My work around thus far is using a template for my
>>>> deploy script. Instead of passing the deploy script arguments, I just
>>>> assign them at the top:
>>>>
>>>> $build = {{ build }}
>>>> $pass = {{ password }}
>>>> $arguments = @{ {{ arguments }} }
>>>>
>>>> This then becomes:
>>>>
>>>> $build = 42
>>>> $pass = password
>>>> $arguments = @{ key1=value1; key2= value2 }
>>>>
>>>> Using the template has given me complete control over the syntax. In
>>>> our paradigm we have an entirely generic "deploy" powershell script that
>>>> stages files, unzips them and similar things. It then calls an "install"
>>>> script that handles all the app specific items. The install scripts are
>>>> bundled with the specific app.
>>>>
>>>> On Wednesday, October 22, 2014 8:38:11 AM UTC-5, J Hawkesworth wrote:
>>>>>
>>>>> I don't have a direct answer for this - rightly or wron

Re: [ansible-project] Ansible quoting

2014-10-23 Thread Chris Church
That method of passing arguments is apparently called "splatting" (
http://technet.microsoft.com/en-us/magazine/gg675931.aspx).

I have a branch where I've been able to get it working:

https://github.com/cchurch/ansible/tree/powershell_splatting


I've also added integration tests to show examples of it in use:

https://github.com/cchurch/ansible/blob/powershell_splatting/test/integration/roles/test_win_script/tasks/main.yml#L50


I also considered the idea of a Jinja2 filter to convert a YAML/JSON data
structure to this format to allow for defining your arguments as you would
any other variables:

build_args:

  key1: value1

  key2: value2


You could then run your task as:

script: dostuff.ps1 {{ build_args|splattify }}


Would you (or any other Windows users) be interested in this approach?


On Wed, Oct 22, 2014 at 10:28 AM, Michael Perzel 
wrote:

> I'll look into this. My work around thus far is using a template for my
> deploy script. Instead of passing the deploy script arguments, I just
> assign them at the top:
>
> $build = {{ build }}
> $pass = {{ password }}
> $arguments = @{ {{ arguments }} }
>
> This then becomes:
>
> $build = 42
> $pass = password
> $arguments = @{ key1=value1; key2= value2 }
>
> Using the template has given me complete control over the syntax. In our
> paradigm we have an entirely generic "deploy" powershell script that stages
> files, unzips them and similar things. It then calls an "install" script
> that handles all the app specific items. The install scripts are bundled
> with the specific app.
>
> On Wednesday, October 22, 2014 8:38:11 AM UTC-5, J Hawkesworth wrote:
>>
>> I don't have a direct answer for this - rightly or wrongly the ps1
>>> scripts I have so far don't take any arguments - I consider them to be
>>> specific to my roles and at the moment they embed some details that it
>>> would probably be best to have as parameters.  However, it looks to me like
>>> your deployLauncher.ps1 really wants to be a very general purpose
>>> deployment tool and maybe it would be better off as an ansible module.
>>> That way you could perhaps take advantage of ansible's existing syntax for
>>> specifying module arguments.
>>>
>>
>> As an aside I believe @Trond Hindenes has a win_package module in the
>> works which might do some of what you want.
>>
>  --
> 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/388179f6-448e-44e7-967f-94e400dc4514%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/CAH%2BKTJ4PaBhzxo2kdNtMvSsd-jeBKDbm-%2BOFZ-RBWakzbWqaFg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible win_msi creates: does it work?

2014-10-03 Thread Chris Church
Taking a closer look at that module, I think you've found a bug.  I'll work
on a fix and some tests.

https://github.com/ansible/ansible-modules-core/issues/129


On Fri, Oct 3, 2014 at 1:07 PM, nfwlpw  wrote:

> Can anyone confirm this is how it works?  I used a file that already
> exists but ansible still seem to tried to install (I saw msiexec being
> started).  Nothing in the output indicates it skipped the task either:
>
>
> TASK: [win_msi path="c:\\temp\\NewRelicAgent_x64_3.6.177.0.msi"
> creates="C:\\Program Files\\New Relic" state=present] ***
> changed: [qa01rlaffvm01.qa.ruelala.lan]
>
> PLAY RECAP
> 
> qa01rlaffvm01.qa.ruelala.lan : ok=2changed=1unreachable=0
> failed=0
>
> This is the same output regardless if I have creates set or not
>
>
>
> On Friday, October 3, 2014 12:19:34 PM UTC-4, Chris Church wrote:
>>
>> creates=somefile does not make ansible create a file; it causes the
>> module to run *only* if the file is missing.
>>
>> You should check for the existence of a file installed by the MSI, e.g.:
>>
>> creates="C:\\Program Files\\New Relic\\Agent.exe"
>>
>>
>>
>> On Fri, Oct 3, 2014 at 10:18 AM, nfwlpw  wrote:
>>
>>> I'm using ansible 1.7.2, here's my very basic playbook:
>>>
>>> ---
>>> - hosts: all
>>>   tasks:
>>>   - win_msi: path=C:\\temp\\NewRelicAgent_x64_3.6.177.0.msi
>>> creates=C:\\temp\\NewRelicAgent_x64_3.6.177.0.txt state=present
>>>
>>>
>>> I expect ansible to create the file specified, but that does not seem to
>>> be the case.  From looking at the win_msi module (I know nothing of
>>> powershell), it only checks the existence, but doesn't actually creates
>>> anything?  Moreover, if I create C:\\temp\\NewRelicAgent_x64_3.6.177.0.txt
>>> manually, ansible still goes on and install the MSI.
>>>
>>> How is it supposed to work?
>>>
>>>
>>>  --
>>> 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-proje...@googlegroups.com.
>>> To post to this group, send email to ansible...@googlegroups.com.
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/ansible-project/6d5952c0-afc8-4d2b-8053-
>>> 668df4075ace%40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/6d5952c0-afc8-4d2b-8053-668df4075ace%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 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/a0a5807d-d8af-4569-b7de-444698dd2b33%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/a0a5807d-d8af-4569-b7de-444698dd2b33%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 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/CAH%2BKTJ40bgZiD3zO6pf-2b3VFP4pZVGuhY_zqptxRPet2iDzGA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible win_msi creates: does it work?

2014-10-03 Thread Chris Church
creates=somefile does not make ansible create a file; it causes the module
to run *only* if the file is missing.

You should check for the existence of a file installed by the MSI, e.g.:

creates="C:\\Program Files\\New Relic\\Agent.exe"



On Fri, Oct 3, 2014 at 10:18 AM, nfwlpw  wrote:

> I'm using ansible 1.7.2, here's my very basic playbook:
>
> ---
> - hosts: all
>   tasks:
>   - win_msi: path=C:\\temp\\NewRelicAgent_x64_3.6.177.0.msi
> creates=C:\\temp\\NewRelicAgent_x64_3.6.177.0.txt state=present
>
>
> I expect ansible to create the file specified, but that does not seem to
> be the case.  From looking at the win_msi module (I know nothing of
> powershell), it only checks the existence, but doesn't actually creates
> anything?  Moreover, if I create C:\\temp\\NewRelicAgent_x64_3.6.177.0.txt
> manually, ansible still goes on and install the MSI.
>
> How is it supposed to work?
>
>
>  --
> 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/6d5952c0-afc8-4d2b-8053-668df4075ace%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/CAH%2BKTJ5wh%3D_vWsX-4fYcMt%3DMKU2OKb%3DUR60PWTuonf%2BEYnqJHw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Run powershell command as administrator

2014-09-30 Thread Chris Church
There is not a way to specify a "run as administrator" option to the remote
shell.  I don't think it's an Ansible or pywinrm issue; I simply don't see
a way to specify that option when creating a remote shell (
http://msdn.microsoft.com/en-us/library/cc251739.aspx).

Your issue may be related to the "second hop" problem, where it's not
allowing your credentials to be used by Invoke-Command:

http://blogs.technet.com/b/heyscriptingguy/archive/2012/11/14/enable-powershell-quot-second-hop-quot-functionality-with-credssp.aspx


I can reproduce it by running the following as a script:

Invoke-Command -ComputerName . { Write-Host "moo" }


I'm not quite sure what the fix would be at the moment -- suggestions
welcome from any PowerShell experts lurking here.



On Wed, Sep 24, 2014 at 10:44 AM, Michael Perzel 
wrote:

> From here http://technet.microsoft.com/en-us/library/hh849719.aspx
>
> My problem is this requirement
>
>-
>
>On Windows Vista, and later versions of Windows, to use the
>*ComputerName* parameter of *Invoke-Command* to run a command on the
>local computer, you must open Windows PowerShell with the "Run as
>administrator" option.
>
>
> On Wednesday, September 24, 2014 9:33:42 AM UTC-5, Michael Perzel wrote:
>>
>> I am working to automate our deployment process with ansible but am
>> running into a permissions issue. I have a playbook that uses the raw
>> module to call a deploy.ps1 file that is on a remote windows server. This
>> deploy.ps1 file does some work and then calls an install.ps1 command using
>> the following syntax "Invoke-Command -ComputerName $server -filepath
>> $from\install.ps1 -argumentlist $version,$siteName"  The problem is
>> install.ps1 needs to be run as administrator in order to work (it makes
>> some changes to IIS). I can run deploy.ps1 (and install.ps1) from an
>> administrator powershell window but they fail when I run them from a
>> non-admin powershell window.
>>
>> Is there a way to tell the raw command to run the powershell as admin?
>>
>> Copied below is the error message.
>>
>>  "stderr": "[localhost] Connecting to remote server localhost failed with
>> the following \r\nerror message : Access is denied. For more information,
>> see the \r\nabout_Remote_Troubleshooting Help topic.\r\n+
>> CategoryInfo  : OpenError: (localhost:String) [], PSRemotingTran
>> \r\n   sportException\r\n+ FullyQualifiedErrorId : AccessDenied,
>> PSSessionStateBroken\r\n",
>> "stdout": "\nDeploying EdgeTestTool version:532 to servers:
>> localhost\n\tCopying files to localhost\n\nFile copy complete. Starting
>> install\n\tInstalling on remote server localhost in site Default Web
>> Site\nC:\\surescripts\\edge\\532\\archive\\EdgeTestTool.
>> Web\\obj\\x64\\Debug\\Package\\PackageTmp, 532, Default Web
>> Site\r\n\nDone Deploying EdgeTestTool version:532 to servers:
>> localhost\n\n",
>>
>>  --
> 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/292dd8e7-49e7-4cb4-8826-1df1bd11c245%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/CAH%2BKTJ4-5wV2JnhebaJE7R56wapm6k9je1C2mhJeLP4QEo-5nQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: win_ping issue

2014-09-30 Thread Chris Church
It looks like it's still trying to use ssh instead of winrm, which
indicates your group vars still aren't being used.  Based on your inventory
from the messages below, your host doesn't appear to be listed in a
"windows" group, so it won't use group_vars/windows.yml.

Try adding the following lines to your inventory to include your host in a
windows group:

[windows]
ADS-6999




On Mon, Sep 29, 2014 at 11:21 AM, Jonathan Anderson <
andersonjonatha...@gmail.com> wrote:

> My windows.yml file is in the group_vars directory and contains
> ---
> ansible_ssh_user: ansmgr
> ansible_ssh_pass: ansiblepw
> ansible_ssh_port: 5986
> ansible_connection: winrm
>
> Here is my output
>
> [ansmgr@LinuxControlMachine etc]$ *ansible ADS-6999 -m win_ping -*
> <123.123.123.123> ESTABLISH CONNECTION FOR USER: ansmgr
> <123.123.123.123> REMOTE_MODULE win_ping
> <123.123.123.123> EXEC ['ssh', '-C', '-tt', '-vvv', '-o',
> 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o',
> 'ControlPath=/home/ansmgr/.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=50',
> '123.123.123.123', "/bin/sh -c 'mkdir -p
> $HOME/.ansible/tmp/ansible-tmp-1411997765.4-206807213502142 && chmod a+rx
> $HOME/.ansible/tmp/ansible-tmp-1411997765.4-206807213502142 && echo
> $HOME/.ansible/tmp/ansible-tmp-1411997765.4-206807213502142'"]
> ADS-6999 | FAILED => SSH encountered an unknown error. The output was:
> OpenSSH_6.4, OpenSSL 1.0.1e-fips 11 Feb 2013
> debug1: Reading configuration data /etc/ssh/ssh_config
> debug1: /etc/ssh/ssh_config line 51: Applying options for *
> debug1: auto-mux: Trying existing master
> debug1: Control socket
> "/home/ansmgr/.ansible/cp/ansible-ssh-123.123.123.123-22-ansmgr" does not
> exist
> debug2: ssh_connect: needpriv 0
> debug1: Connecting to 123.123.123.123 [123.123.123.123] port 22.
> debug2: fd 3 setting O_NONBLOCK
> debug1: connect to address 123.123.123.123 port 22: Connection refused
> ssh: connect to host 123.123.123.123 port 22: Connection refused
>
>
> Here is my output when I include --ask-pass
>
> ansmgr@LinuxControlMachine group_vars]$ *ansible ADS-6999 -m win_ping -k
> --ask-pass -*
> SSH password:
> <123.123.123.123> ESTABLISH CONNECTION FOR USER: ansmgr
> <123.123.123.123> REMOTE_MODULE win_ping
> <123.123.123.123> EXEC ['sshpass', '-d6', 'ssh', '-C', '-tt', '-vvv',
> '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o',
> 'ControlPath=/home/ansmgr/.ansible/cp/ansible-ssh-%h-%p-%r', '-o',
> 'Port=22', '-o', 'GSSAPIAuthentication=no', '-o',
> 'PubkeyAuthentication=no', '-o', 'ConnectTimeout=50', '123.123.123.123',
> "/bin/sh -c 'mkdir -p
> $HOME/.ansible/tmp/ansible-tmp-1412000604.71-243055722371675 && chmod a+rx
> $HOME/.ansible/tmp/ansible-tmp-1412000604.71-243055722371675 && echo
> $HOME/.ansible/tmp/ansible-tmp-1412000604.71-243055722371675'"]
> ADS-6999 | FAILED => SSH encountered an unknown error. The output was:
> OpenSSH_6.4, OpenSSL 1.0.1e-fips 11 Feb 2013
> debug1: Reading configuration data /etc/ssh/ssh_config
> debug1: /etc/ssh/ssh_config line 51: Applying options for *
> debug1: auto-mux: Trying existing master
> debug1: Control socket
> "/home/ansmgr/.ansible/cp/ansible-ssh-123.123.123.123-22-ansmgr" does not
> exist
> debug2: ssh_connect: needpriv 0
> debug1: Connecting to 123.123.123.123 [123.123.123.123] port 22.
> debug2: fd 3 setting O_NONBLOCK
> debug1: connect to address 123.123.123.123 port 22: Connection refused
> ssh: connect to host 123.123.123.123 port 22: Connection refused
>
>
> I examined the file /etc/ssh/ssh_config specifically line 51
>
> Here is a portion of that file
>
> 20 # Host *
> 21 #   ForwardAgent no
> 22 #   ForwardX11 no
> 23 #   RhostsRSAAuthentication no...
>
> ...
> 47 #   PermitLocalCommand no
> 48 #   VisualHostKey no
> 49 #   ProxyCommand ssh -q -W %h:%p gateway.example.com
> 50 #   RekeyLimit 1G 1h
> 51 Host *
>
>
> Is line 51 intended to be uncommented?
>
> If I comment out line 51 I get this output.
>
> [ansmgr@LinuxControlMachine ssh]$ *ansible ADS-6999 -m win_ping -k
> --ask-pass -*
> SSH password:
> <123.123.123.123> ESTABLISH CONNECTION FOR USER: ansmgr
> <123.123.123.123> REMOTE_MODULE win_ping
> <123.123.123.123> EXEC ['sshpass', '-d6', 'ssh', '-C', '-tt', '-vvv',
> '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o',
> 'ControlPath=/home/ansmgr/.ansible/cp/ansible-ssh-%h-%p-%r', '-o',
> 'Port=22', '-o', 'GSSAPIAuthentication=no', '-o',
> 'PubkeyAuthentication=no', '-o', 'ConnectTimeout=50', '123.123.123.123',
> "/bin/sh -c 'mkdir -p
> $HOME/.ansible/tmp/ansible-tmp-1412000787.68-252576189555801 && chmod a+rx
> $HOME/.ansible/tmp/ansible-tmp-1412000787.68-252576189555801 && echo
> $HOME/.ansible/tmp/ansible-tmp-1412000787.68-252576189555801'"]
> ADS-6999 | FAILED => SSH encountered an unknown error. The output was:
> OpenSS

Re: [ansible-project] Re: how to debug random errors on win_msi Windows module?

2014-08-28 Thread Chris Church
Damon -- I've been getting occasional stack overflow and out of memory
exceptions when testing against Server 2008 R2 without updates.  See
https://github.com/ansible/ansible/pull/8345#issuecomment-52074837 for a
hotfix that might work.

Running with -v when using winrm provides even more output, including
all of stderr if something goes wrong, whereas - only displays a
truncated version (e.g. WINRM RESULT ).

Make sure you're running the latest pywinrm (pip install -U
http://github.com/diyan/pywinrm/archive/master.zip#egg=pywinrm).  I'd
submitted some fixes earlier this week related to timeouts; previously you
would get 500 errors for any command taking longer than 60 seconds.



On Thu, Aug 28, 2014 at 6:06 PM, Damon Overboe 
wrote:

> Well I'm consistently getting StackOverflows now too, so I think the two
> might be related; some kind of infinite loop that sometimes runs out of
> memory before it can overflow the stack.
>
> The VMs should have plenty of memory, but, then again some of the VMs we
> have are a bit laggy, so I'm trying some other servers too.
>
> I'm a bit fried though, so I'm probably going to put this on hold for
> tonight, I'll hit it clean tomorrow.
>
>
> I have the latest from your win_package branch, plus the patch to
> powershell. I also have a clean checkout from the ansible devel branch, and
> I'm seeing it in both.
>
> To be safe, I think tomorrow I'll do clean checkouts of both again, just
> to make sure I haven't hosed something on my end.
>
>
>
>
> On Thursday, August 28, 2014 4:05:36 PM UTC-5, Trond Hindenes wrote:
>
>> Out of memory? For real? I havent seen that since the 90's. Put some more
>> ram in your box?
>>
>> On Thursday, August 28, 2014 7:38:24 PM UTC+2, Damon Overboe wrote:
>>
>> "seen it without that as well" = seen the StackOverflow on the mainline
>> dev branch, using win_msi and the powershell.ps1 from the mainline as well.
>>
>> On Thursday, August 28, 2014 12:26:44 PM UTC-5, Damon Overboe wrote:
>>
>> Cool I just hit the StackOverflow again.
>>
>> I used win_get_url to download, and then win_package to install. I am
>> using the updated powershell.ps1 script from 8759, but I have seen it
>> without that as well.
>>
>> failed: [clone] => {"failed": true, "parsed": false}
>> invalid output was:
>> Process is terminated due to StackOverflowException.
>>
>>
>> FATAL: all hosts have already failed -- aborting
>>  
>> < PLAY RECAP >
>>  
>> \   ^__^
>>  \  (oo)\___
>> (__)\   )\/\
>> ||w |
>> || ||
>>
>>
>>to retry, use: --limit @/home/damon/slaves-svn-package.retry
>>
>> clone : ok=2changed=1unreachable=0failed=1
>>
>>
>> The only two files in the temp directory on the remote are the
>> `arguments` file and `powershell.ps1`. Here are the contents of the args
>> file:
>>
>> {"arguments": "ADDLOCAL=CLI", "creates": "C:\\Program
>> Files\\TortoiseSVN", "ensure": "present", "name": "TortoiseSVN-1.7.15",
>> "path": "E:\\.installs\\tortoise-1.7.msi", "product_id":
>> "{087D2CC7-C1FA-45EC-9FC1-B06CA4A073A0}"}
>>
>> I'm going to try changing up the values a bit and see if it's bad
>> arguments going into it.  Here is the playbook (currently), and I'm also
>> going to try rerunning with -
>>
>>   - name: get svn client - version 1.7
>> win_get_url:
>>   url: 'http://sourceforge.net/projects/tortoisesvn/files/1.
>> 7.15/Application/Tor$
>>   dest: 'E:\.installs\tortoise-1.7.msi'
>>
>>   - name: ensure svn is version 1.7
>> win_package:
>>   path='E:\.installs\tortoise-1.7.msi'
>>   name='TortoiseSVN-1.7.15'
>>   product_id='{087D2CC7-C1FA-45EC-9FC1-B06CA4A073A0}'
>>   creates='C:\Program Files\TortoiseSVN'
>>   ensure=present
>>   arguments="ADDLOCAL=CLI"
>>
>>
>>
>>
>> On Thursday, August 28, 2014 10:59:29 AM UTC-5, Damon Overboe wrote:
>>
>> I changed it to run win_get_url to download the package so I could rename
>> the file (using 'dest').
>>
>> And then, I hit a nice System.OutOfMemoryException.  This server isn't
>> that beefy and it's wanting to run updates, so it could be that... but I'm
>> going to try to grab the remote files anyway.
>>
>> I wasn't running -, here's what I saw:
>>
>> failed: [clone] => {"failed": true, "parsed": false}
>> invalid output was: Exception of type 'System.OutOfMemoryException' was
>> thrown.
>> At C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409241114.
>> 17-71859971213315
>> \win_package.ps1:1395 char:5
>> + if ($testdscresult -eq $true)
>> + 
>> + CategoryInfo  : OperationStopped: (:) [],
>> OutOfMemoryException
>> + FullyQualifiedErrorId : System.OutOfMemoryException
>>
>>
>>
>> FATAL: all hosts have already failed -- aborting
>>  
>> < PLAY RECAP >
>>  
>> \   ^__^
>>  \  (oo)\___
>> (__)\   )\/\
>> ||w |
>> ||

Re: [ansible-project] Re: [Ansible to Windows] IndexError: tuple index out of range

2014-08-26 Thread Chris Church
The IndexError traceback was fixed by
https://github.com/ansible/ansible/commit/07f12539eee2faac5fe831cd31f1f0a5d3e7e661,
and I just pushed a fix for running windows modules from playbooks (
https://github.com/ansible/ansible/commit/57dee4545b3c34d1e66943def8d5e45ee95d66bd
).

The winrm integration tests are working for me now using ansible@devel and
pywinrm@master.


On Fri, Aug 22, 2014 at 11:55 AM, Michael DeHaan 
wrote:

> Any thoughts on this Chris?
>
>
>
>
> On Fri, Aug 22, 2014 at 11:05 AM, Joe G  wrote:
>
>> I found this issue started happening to me after this update of pywinrm:
>> https://github.com/diyan/pywinrm/tree/7ab74a4b8fbeb2af707c5628703c485f8d14238d
>>
>> So, I started using an earlier version:
>> pip install
>> https://github.com/diyan/pywinrm/archive/df049454a9309280866e0156805ccda12d71c93a.zip
>>
>> Joe
>>
>> On Friday, August 22, 2014 8:55:11 AM UTC-5, Matt Martz wrote:
>>
>>> This is probably the same issue as what is mentioned at
>>> https://github.com/ansible/ansible/issues/8720
>>>
>>> However, without the traceback in the issue I am unsure.
>>>
>>> The specific traceback that you are seeing, is masking the real issue.
>>>  The real issue likely occurred earlier causing the
>>> initial WinRMTransportError exception to be raised.
>>>
>>>
>>> On Fri, Aug 22, 2014 at 8:25 AM, Avinash Singh 
>>> wrote:
>>>
  I am experiencing the same issue.


 On Friday, 22 August 2014 08:25:31 UTC+2, Zhenkai Jiang wrote:
>
> Hi All,
>
> I am a very newbie to Ansible.  I am running Ansible 1.8-dev from
> source (Tried 1.7.1 from pip as well)
>
> I wanted to control windows machine So I setuped the workstation
> (Centos 6.3) followed steps on http://docs.ansible.com/intro_
> windows.html
>
> Below is what I got:
>
> [root@ansible-test-1 ~]# ansible windows  -i ~/hosts  -m win_ping
> --ask-vault-pass -
> Vault password:
> <15.126.222.251> ESTABLISH WINRM CONNECTION FOR USER: Administrator on
> PORT 5986 TO 15.126.222.251
> <15.126.222.251> WINRM CONNECT: transport=plaintext endpoint=
> https://15.126.222.251:5986/wsman
> 15.126.222.251 | FAILED => Traceback (most recent call last):
>   File "/root/ansible/lib/ansible/runner/__init__.py", line 566, in
> _executor
> exec_rc = self._executor_internal(host, new_stdin)
>   File "/root/ansible/lib/ansible/runner/__init__.py", line 678, in
> _executor_internal
> return self._executor_internal_inner(host, self.module_name,
> self.module_args, inject, port, complex_args=complex_args)
>   File "/root/ansible/lib/ansible/runner/__init__.py", line 849, in
> _executor_internal_inner
> conn = self.connector.connect(actual_host, actual_port,
> actual_user, actual_pass, actual_transport, actual_private_key_file)
>   File "/root/ansible/lib/ansible/runner/connection.py", line 44, in
> connect
> self.active = conn.connect()
>   File "/root/ansible/lib/ansible/runner/connection_plugins/winrm.py",
> line 132, in connect
> self.protocol = self._winrm_connect()
>   File "/root/ansible/lib/ansible/runner/connection_plugins/winrm.py",
> line 90, in _winrm_connect
> err_msg = str(exc.args[0])
> IndexError: tuple index out of range
>
>
> Any advices? Really appreciated that.
>
  --
 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-proje...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/ansible-project/c41741d2-1c5d-4a10--
 29a05cde7255%40googlegroups.com
 
 .

 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>>>
>>> --
>>> Matt Martz
>>> ma...@sivel.net
>>> http://sivel.net/
>>>
>>  --
>> 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/032c3fb1-3be8-45ad-9beb-07532432772a%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 unsubscrib

Re: [ansible-project] Ubuntu Controller with Windows Host

2014-08-26 Thread Chris Church
The latest pywinrm (as of
https://github.com/diyan/pywinrm/commit/1bb5ee32a559624f9e2c08ba3b1b2f4bdf0d8bcb)
has issues when using the winrm.Session class and the URL contains an IP
address, so I wouldn't expect your example above to work at the moment.

As mentioned in the other ansible-project thread, the IndexError should be
fixed as of
https://github.com/ansible/ansible/commit/07f12539eee2faac5fe831cd31f1f0a5d3e7e661
(which was committed Friday afternoon EDT).

Trying to use win_ping (or any other windows module) from a playbook was
also broken until my commit earlier this evening (
https://github.com/ansible/ansible/commit/57dee4545b3c34d1e66943def8d5e45ee95d66bd)
-- That bug would've given you the error "Processing -File 'C' failed
because the file does not have a '.ps1' extension. Specify a valid Windows
PowerShell script file name, and then try again."

Let me know if you're still having issues using the latest ansible@devel
and pywinrm@master.


On Sat, Aug 23, 2014 at 4:10 PM, john zenou  wrote:

> Hi all
>
> I have exactly the same problem and I agree too that all points to an
> pywinrm issue.
> Does anyone know what is causing this and how to solve it ?
>
> Server controle : Ansible 1.7 running on Ubuntu 12.04
> Node : Windows 2008 r2
>
> --
> 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/a958126e-20f5-4e0d-a1ca-14a1a397e248%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/CAH%2BKTJ7C-525wbNAw%2Bob29-d-2j-w93dzOsWObFCY8B_fc3vLw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.