Re: [ansible-project] Re: YUM: Much slower in ansible than on the cli

2014-02-19 Thread Marc Trudel
I think I found the issue - seems to be related to repoquery Following tests were done as suggested with the test-module on the host With repoquery: real0m21.014s user0m4.094s sys0m1.337s Without repoquery: real0m8.130s user0m1.914s sys0m0.449s I guess it is then no long

Re: [ansible-project] Notified handler, but skipped

2014-02-19 Thread Dan C
Thanks Michael, I supposed it was that (the when), but yet it seems strange to me the fact that a handler can be notified and yet skipped. Anyway, I changed the play and I like it much more. I just moved all handlers to one separate file and included that file at the start of the play. Now not o

[ansible-project] setup module fails

2014-02-19 Thread Marc Patermann
Hi, I added about 70 (mostly?) identical servers to my inventory. On two I get this error: # ansible -m setup -i produktion paps077* paps077.example.com | FAILED >> { "failed": true, "msg": "Traceback (most recent call last):\n File \"/home/foo/.ansible/tmp/ansible-1392799041.61-1992

Re: [ansible-project] Re: YUM: Much slower in ansible than on the cli

2014-02-19 Thread Marc Trudel
Quick note. My playbooks break if I do not have repoquery... the code seems to suggest this is optional, but I just found a case, for instance, where checking for an already installed package gave me a recursion error, while another fresh install failed on "failed to parse: SUDO-SUCCESS-whatever

Re: [ansible-project] setup module fails

2014-02-19 Thread Marc Patermann
Hi, Marc Patermann schrieb (19.02.2014 09:47 Uhr): I added about 70 (mostly?) identical servers to my inventory. On two I get this error: # ansible -m setup -i produktion paps077* paps077.example.com | FAILED >> { "failed": true, "msg": "Traceback (most recent call last):\n File \"/h

Re: [ansible-project] Re: YUM: Much slower in ansible than on the cli

2014-02-19 Thread Walid
I am away from my Ansible machine and test, however in my playbook the first thing i do is update yum, and yum-utils to the latest update as i had similar issues with older releases. On 19 February 2014 11:59, Marc Trudel wrote: > Quick note. My playbooks break if I do not have repoquery... t

Re: [ansible-project] setup module fails

2014-02-19 Thread Matt Martz
Marc, I do believe this issue has been resolved in 1.5 (devel). 1.5 is tentatively scheduled to release sometime within the next month, but should be stable enough to use currently. You may want to give it a try and see how it works. On Wednesday, February 19, 2014, Marc Patermann < hans.mo...@

Re: [ansible-project] setup module fails

2014-02-19 Thread Michael DeHaan
Yes, please let us know if it does. I'm pushing for 1.5 to release a bit sooner (weeks) actually. I'd be interested in the remote OS and conditions that triggered this situation. On Wed, Feb 19, 2014 at 7:22 AM, Matt Martz wrote: > Marc, > > I do believe this issue has been resolved in 1.5 (d

Re: [ansible-project] A plugin for task timings

2014-02-19 Thread Michael DeHaan
That's pretty remarkable how small the code is. Well done! https://github.com/jlafon/ansible-profile/blob/master/callback_plugins/profile_tasks.py On Tue, Feb 18, 2014 at 11:19 PM, Jharrod LaFon wrote: > I'm posting this here in case anyone finds it useful. I've written a very > simple plugi

Re: [ansible-project] setup module fails

2014-02-19 Thread Marc Patermann
Michael DeHaan schrieb (19.02.2014 13:54 Uhr): Yes, please let us know if it does. OK, I'm trying to build a RPM from 1.5.0-pre and will report back. I'm pushing for 1.5 to release a bit sooner (weeks) actually. I'd be interested in the remote OS and conditions that triggered this situation.

Re: [ansible-project] with_items/iterations over dictionary for a sysctl task.

2014-02-19 Thread Michael DeHaan
The dictsort just sorts them and doesn't really change much. It sounds like you have a list of sysctl names and each sysctl name has a lot of settings under it. You could consider flattening everything to one list, and also maybe using the "when" operator to filter which to apply. If you had a h

Re: [ansible-project] with_items/iterations over dictionary for a sysctl task.

2014-02-19 Thread Michael DeHaan
Sorry, I meant "lookup" plugin. I mean if you had something like: my_sysctls: one: - { key: x, value: y } - { key: x2, value: y2 } two: ... and wanted to apply all sysctls in one or two. I would probably just keep seperate lists and iterate over them, and keep

Re: [ansible-project] Re: YUM: Much slower in ansible than on the cli

2014-02-19 Thread Michael DeHaan
+1 Also, what (remote) OS is this? We'd have this discussion before, where yum-utils we were pretty sure was only excluded in @core installs. That might not b e true though -- need to check. I have no problem making the yum module self-add yum-utils if not already there if it resolves problems

Re: [ansible-project] Notified handler, but skipped

2014-02-19 Thread Michael DeHaan
"I am using "when"s because I want to have only one playbook and apply the roles always depending on the machine type. Is there any other way to do this?" Yep! Use groups in that one playbook, and have more than one play: - hosts: common roles: - common - hosts: webservers roles: -

Re: [ansible-project] setup module fails

2014-02-19 Thread Michael DeHaan
Let us know what remote OS that triggered the problem on for starters. If it's resolved in 1.5, getting that update out should resolve most things -- I haven't heard a lot of reports of this, and it's pretty safe to run 1.5 at this point. Won't always be the case, but we're getting this ready to

Re: [ansible-project] setup module fails

2014-02-19 Thread Marc Patermann
Michael DeHaan schrieb (19.02.2014 14:06 Uhr): Let us know what remote OS that triggered the problem on for starters. SLES 10 SP 2 64 bit, but it is only on 2 of about 70 (should be) identical servers. If it's resolved in 1.5, getting that update out should resolve most things -- I haven't he

Re: [ansible-project] call python function from Ansible template

2014-02-19 Thread Khuong Dinh Pham
Thx. It's working fine. Den tirsdag den 18. februar 2014 23.02.25 UTC+1 skrev Michael DeHaan: > > Yep, see here: > > http://docs.ansible.com/intro_configuration.html#filter-plugins > > > > On Tue, Feb 18, 2014 at 4:07 PM, Khuong Dinh Pham > > > wrote: > >> Hi >> >> It working fine if I add the f

[ansible-project] Resolve nested variable in template

2014-02-19 Thread Khuong Dinh Pham
Hi I want to generate the variable names based on another variable value. Something like this: Vars: environements: ["trunk", "dev01"] my_trunk_port: 8080 my_dev01_port: 8180 Template: {{ my_{{ env }}_port }} -- You received this message because you are subscribed to the Google Groups "Ansib

[ansible-project] Documentation Question

2014-02-19 Thread David Adams
As I've been exploring Ansible, I sometimes run into situations where I'm not sure if some certain syntax is allowed in certain situations, or conversely I'll discover in an unrelated example some new syntax combination I'd never considered before. So what I was wondering was whether there exists

Re: [ansible-project] ValueError with pip virtualenv

2014-02-19 Thread Scott Sturdivant
Kesten, Have you tried 'extra_args="--upgrade --no-use-wheel"' ? On Tue, Feb 18, 2014 at 3:16 PM, Michael DeHaan wrote: > Can you please file a github ticket on this? > > Thanks! > > > > > On Tue, Feb 18, 2014 at 5:14 PM, Kesten Broughton < > solarmobiletrail...@gmail.com> wrote: > >> This is

Re: [ansible-project] Documentation Question

2014-02-19 Thread Michael DeHaan
Yep, What you are asking for about what is a keyword in a play, or a task, etc, is quite a good idea, and something I would like to do. On Wed, Feb 19, 2014 at 9:58 AM, David Adams wrote: > As I've been exploring Ansible, I sometimes run into situations where I'm > not sure if some certain s

Re: [ansible-project] Documentation Question

2014-02-19 Thread Serge van Ginderachter
Not really documented in the way you were looking for AFAIK, but the list of valid keys can be found on a relatvely easy place in the code: https://github.com/ansible/ansible/blob/devel/lib/ansible/playbook/play.py#L42 and https://github.com/ansible/ansible/blob/devel/lib/ansible/playbook/task.p

Re: [ansible-project] Documentation Question

2014-02-19 Thread David Adams
Thanks Serge, I've already learned something just from glancing through those lists! :) On Wed, Feb 19, 2014 at 9:20 AM, Serge van Ginderachter < se...@vanginderachter.be> wrote: > Not really documented in the way you were looking for AFAIK, but the list > of valid keys can be found on a relatve

Re: [ansible-project] Resolve nested variable in template

2014-02-19 Thread David Adams
I've been using this pattern: vars: environments: [ "trunk", "dev01" ] my_ports: trunk: 8080 dev01: 8081 template: {{ my_ports[env] }} -dave On Wed, Feb 19, 2014 at 8:03 AM, Khuong Dinh Pham wrote: > Hi > > I want to generate the variable names based on another variable value. >

[ansible-project] Re: Resolve nested variable in template

2014-02-19 Thread Khuong Dinh Pham
Hi Thx for the answer. But this is not a option here. The vars is already defined in this format: my_trunk_port: 8080 my_dev01_port: 8180 my_dev02_port: 8280 my_dev03_port: 8480 and then I have an env var [trunk, dev01, dev02..] to construct the final var name Den onsdag den 19. februar 2014

Re: [ansible-project] Resolve nested variable in template

2014-02-19 Thread Serge van Ginderachter
On 19 February 2014 15:03, Khuong Dinh Pham wrote: > Vars: > environements: ["trunk", "dev01"] > my_trunk_port: 8080 > my_dev01_port: 8180 > > Template: > {{ my_{{ env }}_port }} > ​try something like this: ​ {{ ​hostvars[inventory_hostname][ "my_" + ​env + "_port"] }} if I'm not mistaken..

Re: [ansible-project] Resolve nested variable in template

2014-02-19 Thread Adam Heath
On 02/19/2014 10:11 AM, Serge van Ginderachter wrote: On 19 February 2014 15:03, Khuong Dinh Pham mailto:khuon...@gmail.com>> wrote: Vars: environements: ["trunk", "dev01"] my_trunk_port: 8080 my_dev01_port: 8180 Template: {{ my_{{ env }}_port }} ​try something like t

Re: [ansible-project] Re: Resolve nested variable in template

2014-02-19 Thread Adam Heath
vars: port_vars: my_trunk_port: 8080 my_dev01_port: 8180 my_dev02_port: 8280 my_dev03_port: 8480 - set_fact: my_ports: {} - pause: seconds=0 when: (my_ports[item[0].substring(3).substring(0,len(item[0]) - 3)] = item[1]) and false or false with_items: port_vars.items() - debug:

[ansible-project] Ansible Vault is now merged into devel (1.5)

2014-02-19 Thread James Tanner
We just merged a new feature called "Ansible Vault" to devel (1.5). Please read through Michael Dehaan's blog post about the tools for basic usage: http://blog.ansibleworks.com/2014/02/19/ansible-vault/ Follow the typical bug reporting process for any issues you may find. Other notes: 1) The de

Re: [ansible-project] Re: YUM: Much slower in ansible than on the cli

2014-02-19 Thread Adam Morris
I'm manually adding yum-utils in my RedHat installs as I am performing a minimal install. I figured that this was my fault for trying to install as little as possible. It might make some sense to document that dependency in the yum module page though. Adam On Wednesday, February 19, 2014 5:0

Re: [ansible-project] Re: YUM: Much slower in ansible than on the cli

2014-02-19 Thread C. S.
I just happen to add some crude log traces to my yum module last night to see if I could figure out what it's doing. On RPMs that are already installed it will use up all the CPU/IO for a while, on a small instance it can take a long time. The instance I was testing with was an m1.small, so it

[ansible-project] Re: Ansible Vault is now merged into devel (1.5)

2014-02-19 Thread giulianob
Will this work with lookup so if it generates a pass its stored in the vault automatically? (I asked this in the official post but didn't see my comment.) On Wednesday, February 19, 2014 1:20:34 PM UTC-5, James Tanner wrote: > > We just merged a new feature called "Ansible Vault" to devel (1.5).

Re: [ansible-project] ValueError with pip virtualenv

2014-02-19 Thread Kesten Broughton
I tried it. The error is slightly different but similar Filing a ticket. TASK: [linux_osx_common | Upgrade setuptools] * failed: [prod-pivot] => {"cmd": "ENV1/bin/pip install upgrade no-use-wheel --use-mirrors setuptools", "failed": true, "item": ""} msg: std

Re: [ansible-project] Resolve nested variable in template

2014-02-19 Thread Khuong Dinh Pham
Hi I have added my vars via include_vars and not in hostvars - include_vars: /path/myvars.yml - template: src=input.j2 dest=output.j2 so {{ ​hostvars[inventory_hostname][ "my_" + ​env + "_port"] }} will not working What will the name of the array then be? Den onsdag den 19. februar 20

Re: [ansible-project] Resolve nested variable in template

2014-02-19 Thread Khuong Dinh Pham
It was a typo error from my side. The solution is working fine. Thx a lot Den onsdag den 19. februar 2014 20.48.23 UTC+1 skrev Khuong Dinh Pham: > > Hi > > I have added my vars via include_vars and not in hostvars > > - include_vars: /path/myvars.yml > - template: src=input.j2 dest=output.j2

Re: [ansible-project] Re: Ansible Vault is now merged into devel (1.5)

2014-02-19 Thread James Tanner
On 02/19/2014 02:01 PM, giulianob wrote: Will this work with lookup so if it generates a pass its stored in the vault automatically? (I asked this in the official post but didn't see my comment.) On Wednesday, February 19, 2014 1:20:34 PM UTC-5, James Tanner wrote: We just merged a new fe

Re: [ansible-project] Re: YUM: Much slower in ansible than on the cli

2014-02-19 Thread Marc Trudel
@cove_s nice :) I didn't get to go down that much, but that reflects pretty well what I am experiencing. @Adam @Michael at least for updates, NOT using repoquery made things faster for me. What I did is change the code for the yum module to undefine the repoquery path. On Thursday, February 20