[ansible-project] Re: print template variable

2015-04-17 Thread ddffgpmfn
Trying to work out why this works: TASK: [debug var=groups.security_group_app] *** Friday 17 April 2015 12:15:01 +0100 (0:00:00.301) 0:00:13.586 ** ok: [52.17.198.95] = { var: { groups.security_group_app: [ 52.xx.xx.xx,

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2015-04-17 Thread Steven Haddox
It's been my experience that ansible absolutely requires Python 2.6+ or Python 2.4 with the simplejson module. I don't know where in the documents, but I reference this in my README for my main ansible project: https://github.com/stevenhaddox/ansible_rails_enterprise/blob/master/README.md I also

[ansible-project] print template variable

2015-04-17 Thread ddffgpmfn
Trying to debug a template and want to display the data for a variable. How can I do that from inside a template? {% for foo in bar %} print foo to stdout? {% endfor %} -- You received this message because you are subscribed to the Google Groups Ansible Project group. To unsubscribe from

Re: [ansible-project] Re: looping over set of tasks (roles?)

2015-04-17 Thread Brian Coca
yes On Fri, Apr 17, 2015 at 10:33 AM, Daniel Siechniewicz dan...@siechniewicz.com wrote: Or is this a role for include + with_items that will be available in 2.0? Regards, Daniel -- Brian Coca -- You received this message because you are subscribed to the Google Groups Ansible Project

[ansible-project] Best Practices for dealing with multiple related sets of properties?

2015-04-17 Thread Brad Smith
Hello all, Suppose I want to deploy multiple versions of a service (let's call them v1 and v2, though they could also be different services with the same setup steps) to two environments (dev and prod). Since steps to deploy each version of the service are pretty much the same a single role

[ansible-project] Run Playbook with only several tags with the dependencies

2015-04-17 Thread Ruhut Tambunan
Hello guys, I have a little problem in running a playbook. So, let's just say I have this kind of roles: *myproject* \--roles \++cars.yml \--dodge | \--meta | | \++main.yml | \--tasks | \++main.yml | \++charger.yml | \++viper.yml \--toyota

[ansible-project] Re: Ansible Core Team Hangouts

2015-04-17 Thread René Moser
Great! See you there! Regards René -- 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

[ansible-project] Re: Ansible 1.9.1 rc2 is now available for testing

2015-04-17 Thread René Moser
Hi James -1 from me, because of https://github.com/ansible/ansible/issues/10758 Yours René -- 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

Re: [ansible-project] Re: looping over set of tasks (roles?)

2015-04-17 Thread Daniel Siechniewicz
Or is this a role for include + with_items that will be available in 2.0? Regards, Daniel On 17 April 2015 at 15:08, Daniel Siechniewicz dan...@siechniewicz.com wrote: Hi, Sorry to reanimate this, but I think I have a legit use case for looping over multiple tasks: This is what I've got:

Re: [ansible-project] Re: print template variable

2015-04-17 Thread Brian Coca
you can do this: {% for ec2_host_ip in groups.security_group_app %} {{ ec2_host_ip}} {% endfor %} or {{ groups.security_group_app|pprint}} the combination of both does not make sense. -- Brian Coca -- You received this message because you are subscribed to the Google Groups Ansible

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2015-04-17 Thread Eugene Sajine
yes, i have misstated the problem in my initial question a bit, sorry. I know about the ansible_python_interpreter and it does take care of the simplejson error, as instead of using the interpreter that is available in PATH it uses what i have specified. So the only question about that variable

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2015-04-17 Thread Brian Coca
yes, environment is now settable at task/play level, I have it on my list to add either a global (ansible.cfg) or inventory setting -- Brian Coca -- You received this message because you are subscribed to the Google Groups Ansible Project group. To unsubscribe from this group and stop

Re: [ansible-project] Debugging modules

2015-04-17 Thread Brian Coca
In the ansible repo you can find the hacking/test-module script that allows you to run/test a module and even attach a debugger to the run. Other ways some people use is setting ANSIBLE_KEEP_REMOTE_FILES=1 and using the resulting temporary files as python scripts under a debugger. One note with

Re: [ansible-project] Variable precedence in a group hierarchy

2015-04-17 Thread Sandra Parsick
Serge, thanks for the fast clarification. Am Freitag, 17. April 2015 17:43:00 UTC+2 schrieb Serge van Ginderachter: On 17 April 2015 at 17:31, Sandra Parsick sandra@googlemail.com javascript: wrote: So my question, why my expectation is wrong? ​yes, it's a feature, not a bug :) Io

[ansible-project] Debugging modules

2015-04-17 Thread Christoph Haas
Hi… it assume that the mysql_user module is slightly buggy because it claims changed=1 after a privileges change although nothing was changed. But I don't just like to complain but instead debug the module and see if I can provide a fix. So far I have git-clone'd

Re: [ansible-project] Variable precedence in a group hierarchy

2015-04-17 Thread Serge van Ginderachter
On 17 April 2015 at 17:31, Sandra Parsick sandra.kosma...@googlemail.com wrote: So my question, why my expectation is wrong? ​yes, it's a feature, not a bug :) Io just answered the same question on https://github.com/ansible/ansible/issues/10755, so copy pasting my answer: This is a feature

[ansible-project] Ansible 1.9.1 rc3 is now available for testing

2015-04-17 Thread James Cammarata
Hi all, we've just tagged the rc3 release for 1.9.1 to address a bug reported by Rene Moser. To test from source, simply clone the git repository (if you haven't already) and do the following: $ git checkout v1.9.1-0.3.rc3 $ git submodule update $ . hacking/env-setup After which time you can

Re: [ansible-project] Ansible array manipulation

2015-04-17 Thread Michael Liu
Thanks. I need to brush up on my jinjansiblethon. On Friday, April 17, 2015 at 2:21:32 PM UTC-7, Matt Martz wrote: The best link for jinja2 template docs is: http://jinja.pocoo.org/docs/dev/templates/ Other than that, it's a little bit of python, a little bit of jinja2 and some other

[ansible-project] Ansible array manipulation

2015-04-17 Thread Michael Liu
I'm having an issue adding an element to an array. What i need to do is... 1) get an array list of IDs from an api using the uri module (no issues here) 2) add an element to this array (issue here!) 3) send a PUT with the updated array using uri (no issues here) tasks start - name:

Re: [ansible-project] Ansible array manipulation

2015-04-17 Thread Matt Martz
This isn't tested, but I believe it would look something like: {{ reg_endpoint2.json.array_with_many_elements + [reg_endpoint1.json.id_list[0].id] }} You need to perform the concatenation inside of a single {{ }} On Fri, Apr 17, 2015 at 3:43 PM, Michael Liu purduem...@gmail.com wrote: I'm

Re: [ansible-project] Ansible array manipulation

2015-04-17 Thread Michael Liu
Thank you so much. It's been hard trying to find any documentation on this. Any links to good docs about this topic? I feel like I'll be playing around a lot with json, arrays, and uri module in Ansible. I own you a beer! Next time you visit SF. On Friday, April 17, 2015 at 1:59:36 PM

[ansible-project] ansible loop break hack

2015-04-17 Thread Daniel Siechniewicz
I've got a hack for what seems like a lack of break in ansible loops. How ugly is that (and is there a better way)? - play.xml --- - hosts: all tasks: - file: path=/tmp/THISFAILED state=touch mode=0600 - custom: name={{ item.name }} msg={{ item.msg }} failme={{

[ansible-project] Variable precedence in a group hierarchy

2015-04-17 Thread Sandra Parsick
Hello list, I need to understand following variable precedence problem. I have an inventory file with following group hierarchy: # inventory file host1 host2 [group1] host1 host2 [group11:children] group1 [group12:children] group1 In the group_var files of group *group11* and *group12, *a