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

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

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,

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,

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

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

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

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

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

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

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 tenpenny...@gmail.com 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:

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,

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 mmmegd...@gmail.com 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

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

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:

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:

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 haa...@gmail.com 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

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.:

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

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 yaniv.ref...@gmail.com wrote: Hi, My host machine is windows 8.1 and the

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

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 simon...@gmail.com wrote: Hi all, is it possible to set ansible_sudo_pass in

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=stagetag:Owner=me On Tue, Feb 24, 2015 at 6:46 PM, Daniel Richardson blusk...@gmail.com wrote: Is there any way to use AND in the instance_filters parameter instead of

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 nus...@openmailbox.org wrote: Hi,

Re: [ansible-project] Ansible quoting

2015-02-23 Thread Chris Church
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

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

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

[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 bc...@ansible.com wrote: I just merged changes

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, d...@telnyx.com 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

Re: [ansible-project] Ansible quoting

2015-02-03 Thread Chris Church
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 michae

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 lozai...@gmail.com wrote: We

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 malouf.g...@gmail.com wrote: Are there any roles/module for configuring IAM users, roles, permissions, etc? --

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

2015-01-08 Thread Chris Church
\myapp.log\ /qn' creates: '{{myapp_root}}/sbin/myapp.exe' On Thu, Jan 8, 2015 at 11:58 PM, Chris Church flyingfr...@gmail.com 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

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

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

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

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 alan.ray...@gmail.com wrote: I'm looking to extend the core user module to work (at least partially) with OS X (Darwin). The nearest discussion I can

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

2014-12-25 Thread Chris Church
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

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 (

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

2014-12-19 Thread Chris Church
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

Re: [ansible-project] Re: ansible win_ping WINRM RESULT Response code 0, out , err ConvertTo-Json : Une

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 marwa.nai...@gmail.com wrote: Thanks Jon for your reply,

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.

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,

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 (

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, ji...@pristine.io wrote: Thanks for the reply. I wasn't able to update this

Re: [ansible-project] Ansible quoting

2014-11-06 Thread Chris Church
: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

Re: [ansible-project] Ansible quoting

2014-10-25 Thread Chris Church
)? 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

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

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: '{{

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

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

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 nfw...@gmail.com

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

2014-10-03 Thread Chris Church
.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

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

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

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

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