Re: [ansible-project] register: variable as {{item}}?

2015-03-14 Thread Serge van Ginderachter
What's stopping you from registering this loop task with one variable? The iterated results get registered in a .results list . On 14 March 2015 at 20:19, Rick Kasten rickkas...@gmail.com wrote: - shell: alternatives --display {{ item }} | grep best | grep jre1.7.0_75 sudo: yes register:

[ansible-project] Re: registered variables and ec2 with_items on private and public subnet

2015-03-14 Thread Dan Vaida
I came across this kind of randomness myself: https://groups.google.com/forum/#!topic/ansible-project/Xy3kt0Mr8YY You can set a fact with a sorted list and use it in your next tasks to have predictability. On Wednesday, 11 March 2015 14:48:41 UTC+1, Arbab Nazar wrote: Hi, Below is the

[ansible-project] register: variable as {{item}}?

2015-03-14 Thread Rick Kasten
- shell: alternatives --display {{ item }} | grep best | grep jre1.7.0_75 sudo: yes register: {{ item }} ignore_errors: with_items: - java - javaws - jcontrol I've tried several iterations of this, all fail. Is there any way this can work? I don't want to have to create 3

Re: [ansible-project] register: variable as {{item}}?

2015-03-14 Thread Rick Kasten
Nothing's stopping me. I don't know what you're referring to. -- 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

[ansible-project] version_compare not working

2015-03-14 Thread Rick Kasten
This is doing the complete opposite of matching, right? TASK: [play | debug var=installed_app_version] *** 10.101.1.105 ok: [twp01] = { installed_app_version: 5.4.0 } TASK: [play | debug var=package_versions.app.app] *** 10.101.1.105 ok: [twp01] = { package_versions.app.app: 5.4.0 }

Re: [ansible-project] version_compare not working

2015-03-14 Thread Matt Martz
The problem seems to be improper quoting in this part: version_compare('package_versions.app.app','==') You don't want to quote the var, it should just be: version_compare(package_versions.app.app,'==') On Saturday, March 14, 2015, Rick Kasten rickkas...@gmail.com wrote: This is doing the

[ansible-project] Re: Docker module required arguments - should image always be mandatory?

2015-03-14 Thread Ash Wilson
Hi, Dave. That's a good point. Really, all that you need to specify is a way to uniquely identify the set of containers that you want the task to operate on. This is either: 1. name, OR 2. image, plus optional command. If you're using a state that could *create* a new container, then the

[ansible-project] Re: need help getting started using Ansible conditionals with regards to the absence/presence of Docker containers

2015-03-14 Thread Ash Wilson
Hi Ken, I don't think it's possible right now to remove *all* containers in one go. If you do have a name, and you're using the 1.9 prerelease, you should able to run: - name: stop and remove the container thename docker: state: absent name: thename image: ignored You can also

[ansible-project] Re: Access a variable defined in a playbook - within a role

2015-03-14 Thread Rick Kasten
This may not directly answer your question, but this how I am handling that same issue. We have definitions of packages and rpms defined in group_vars and host_vars: # inventory/dse/group_vars/dse/package_versions.yml package_versions: app: app: 4.6.1 jre: jre-1.7.0_75-fcs.x86_64

[ansible-project] Re: Access a variable defined in a playbook - within a role

2015-03-14 Thread Adrian Paraschiv
Thanks for the reply but if I run a role 10 times in a playbook and only on the 5th run of that role I want it to run the second shell cmd from within that role. How can I address that ? If I can insert some variable within the playbook (outside the role) in the beggining something like: vars: