[ansible-project] ec2_elb module does not register ec2_instances properly (version 1.4.3 and 1.4.4)

2014-01-31 Thread Jeff Wyckoff
*Issue:* Trying to register an ec2 instance to an elb. However, the ec2_elb module doesn't seem to work properly. It claims that the ec2 instance does not exist. However, when I manually registered the ec2 instance to the elb within aws console, then de-registered it, the ec2_elb module worke

[ansible-project] Re: ec2 module user-data?

2014-01-31 Thread David Peterka
Do like this: user_data"#!/bin/bash\nsleep 10" you can pass python style \n newlines. On Friday, January 10, 2014 5:01:00 PM UTC-5, Kevin Fenzi wrote: > > Greetings. > > I find myself wanting to pass some user_data to a call to the ec2 > module, but I am unclear on the format I should be pa

Re: [ansible-project] addition of solaris to service module?

2014-01-31 Thread Paul Wolstenholme
Oops. I should have check first: https://github.com/ansible/ansible/pull/2490 Works great. Thanks! Cheers, Paul On Friday, January 31, 2014 4:22:24 PM UTC-8, Paul Wolstenholme wrote: > > Curious where this ended up. This would be awesome. > > Cheers, > Paul > > On Sunday, September 23, 2012 5:2

Re: [ansible-project] addition of solaris to service module?

2014-01-31 Thread Paul Wolstenholme
Curious where this ended up. This would be awesome. Cheers, Paul On Sunday, September 23, 2012 5:20:13 PM UTC-7, Romeo Theriault wrote: > > On Sun, Sep 23, 2012 at 12:50 PM, Michael DeHaan > > wrote: > >> > >> For example: > >> * enabling and disabling a service in aix requires editing /etc/i

Re: [ansible-project] Use pfexec instead of sudo

2014-01-31 Thread Michael DeHaan
It's currently not configurable on a per inventory variable basis, but patches to add a ansible_sudo_exe parameter would be considered for sure. On Fri, Jan 31, 2014 at 6:45 PM, Paul Wolstenholme wrote: > Thanks Brian. I'll give that a try. Although, I would like to use both. We > have both l

Re: [ansible-project] Use pfexec instead of sudo

2014-01-31 Thread Paul Wolstenholme
Thanks Brian. I'll give that a try. Although, I would like to use both. We have both linux and smartos boxes we would like to do specify within the context of a playbook or inventory file. sudo will work on Smartos but pfexec seems to be prefered in the Solaris world. Cheers, Paul On Fri, Jan 31

Re: [ansible-project] Use pfexec instead of sudo

2014-01-31 Thread Brian Coca
If pfexec can take same command line arguments as sudo, use ANSIBLE_SUDO_EXE env variable or sudo_exe entry in ansible .cfg to point to it. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emai

[ansible-project] Use pfexec instead of sudo

2014-01-31 Thread Paul Wolstenholme
Is it possible to specify pfexec instead of sudo in a playbook. Something like: sudo_command: pfexec or root_command: pfexec Cheers, Paul -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving

Re: [ansible-project] register variable being truncated

2014-01-31 Thread Adam Heath
debug: msg="{{ commit error }}" On 01/31/2014 11:55 AM, David Gethings wrote: Hi, I am working with a custom module. Sometimes it returns an error that I want to capture and then act on in another task. I have a register set and ignore_errors set to True in the playbook. However the msg returne

Re: [ansible-project] idea: invoke tags for roles in role definition

2014-01-31 Thread Mattias Gees
Hi Xie, We solved the problems with the yum repos an other way. Maybe a way to solve this is by using when with your task. You pass a variable with your role and check that with the when clause of your task. If you for example define your role the following way: - { role: foo_role, execute: fals

Re: [ansible-project] different groups with different variables using the same role in the same host

2014-01-31 Thread Adam Heath
I've been using variants of dict.keys(), dict.values(), and dict.items() when utilizing with_items iteration. On 01/31/2014 09:07 AM, Guillem Liarte wrote: This works however: ## --- - hosts: moscatell tasks: - debug: msg="{{ project[item] }}" with_items: project_list -- You

Re: [ansible-project] idea: invoke tags for roles in role definition

2014-01-31 Thread Chaoran Xie
hi Michael, Just want to check if this is what tags already do. "I want to run this role but only those tasks who have the following tags. That way you don't need to specify them on the command line."(Vincent above described exactly what i need). I read your solution below to use multiple role

Re: [ansible-project] different groups with different variables using the same role in the same host

2014-01-31 Thread Guillem Liarte
Kahlil, I found a way to adress those values stored in the array: - name: Create directories file: state=directory path=/data/db/{{ project[item].domain }} owner=root group=root mode=0770 with_items: project_list This creates effectively: /data/ └── db ├── test1.com └── test2.com

Re: [ansible-project] different groups with different variables using the same role in the same host

2014-01-31 Thread Guillem Liarte
This works however: ## --- - hosts: moscatell tasks: - debug: msg="{{ project[item] }}" with_items: project_list GATHERING FACTS *** ok: [moscatell] TASK: [debug msg="{{project[item]}}"] ***

[ansible-project] Variable validation for user input

2014-01-31 Thread Doug Campbell
Is there an easy way to validate user imputed variables in a playbook? I am taking in an IP address from a vars_prompt and I just want to validate the variable to make sure the IP does not have any typos before using it in a lineinfile task. Do I need to make a module for this or am I just missi

[ansible-project] register variable being truncated

2014-01-31 Thread David Gethings
Hi, I am working with a custom module. Sometimes it returns an error that I want to capture and then act on in another task. I have a register set and ignore_errors set to True in the playbook. However the msg returned is being truncated to I cannot perform a 'when' conditional on its value. B

Re: [ansible-project] Testing for a defined but non empty string

2014-01-31 Thread Adam Heath
foo is defined and foo !+ "" or "default-value" On 01/31/2014 06:46 AM, Stephen Ryan wrote: Thanks, that will work in the case of foo: "". Before I go about switching all our templates, is there a way to also make it work in the case of foo: , i.e. without the empty string defined? Ansible detec

Re: [ansible-project] idea: invoke tags for roles in role definition

2014-01-31 Thread Chaoran Xie
Hi Vincent, Did you guys ever find a way to "run this role but only those tasks who have the following tags. That way you don't need to specify them on the command line". It seems that at one point Michael DeHaan said it below that this is what tags already do but i wasnt able to get it to wor

[ansible-project] Re: rabbitmq json config to setup exchanges and queues

2014-01-31 Thread Chris Hoffman
You should be able to just write the config file in the default location and when you restart rabbitmq it will pick up these settings. We usually have our publishers create exchanges and consumers create exchange, bindings, and queues as opposed as configuring them in the rabbitmq config files

[ansible-project] Re: rabbitmq_user user state=absent error

2014-01-31 Thread Chris Hoffman
What version of ansible are you running? As far as I can tell, the current implementation of the module should handle your situation correctly. The one thing that is odd to me is the command that you are returning, and getting the error on, would never be run in the current implementation of

Re: [ansible-project] Re: rabbitmq_user user state=absent error

2014-01-31 Thread Michael DeHaan
Excellent, thanks Chris! On Fri, Jan 31, 2014 at 12:57 PM, Chris Hoffman < christopher.hoff...@gmail.com> wrote: > I'll take a look and see if I can figure out what is going on here. > > > On Thursday, January 30, 2014 2:58:52 PM UTC-5, > david.n...@warbyparker.comwrote: >> >> When I run the ta

[ansible-project] Re: rabbitmq_user user state=absent error

2014-01-31 Thread Chris Hoffman
I'll take a look and see if I can figure out what is going on here. On Thursday, January 30, 2014 2:58:52 PM UTC-5, david.n...@warbyparker.com wrote: > > When I run the task: > > - rabbitmq_user: user=guest state=absent node=srv1 > > The error: > > failed: [v-cep01] => {"changed": true, "cmd": "/

Re: [ansible-project] Odd message on Amazon Linux

2014-01-31 Thread Stan Lemon
I'm using 1.4.4, installed from EPEL, Python is 2.6. It's a brand new Amazon Linux machine. - Stan Lemon stosh1...@gmail.com On Fri, Jan 31, 2014 at 8:11 AM, Michael DeHaan wrote: > Using an EL5 based OS to run Ansible is pretty unusual now since we > require Python 2.6. > (aka no EL 5) > > Th

Re: [ansible-project] Testing for a defined but non empty string

2014-01-31 Thread Nick Groenen
Yes, if Ansible sees that as None, then you could use |default(None) like this: when: foo|default(None) != None -- Nick Groenen | zoni | @NickGroenen https://zoni.nl | GnuPG/GPG key ID: 0xAB5382F6 -- You received this message because you are subscribed to the Google Groups "Ansible Project" gr

Re: [ansible-project] different groups with different variables using the same role in the same host

2014-01-31 Thread Guillem Liarte
Kahlil, Thanks for the reply. I have tried your exact example in a new ansible instance. I had to adapt it as the playbook would not pass syntax checks: ## --- - hosts: - host1 tasks: - debug: msg="{{ project[item][domain]}}" with_items: project_list However I encounter this:

Re: [ansible-project] Odd message on Amazon Linux

2014-01-31 Thread Michael DeHaan
Using an EL5 based OS to run Ansible is pretty unusual now since we require Python 2.6. (aka no EL 5) There is also logic to catch warning noise from paramiko imports now -- what version of Ansible are you using? On Fri, Jan 31, 2014 at 3:46 AM, Peter Gehres wrote: > > https://groups.google.c

[ansible-project] Ansible Design Pattern Question

2014-01-31 Thread Aaron Hunter
I have run into a few cases where I have to make a change to a running service (e.g., iptables and BIND) using a command line tool (iptables, nsupdate). This case is different from the more normal (for me): change config file, upload changed file, restart or reload service. Changing a running s

Re: [ansible-project] Testing for a defined but non empty string

2014-01-31 Thread Stephen Ryan
Thanks, that will work in the case of foo: "". Before I go about switching all our templates, is there a way to also make it work in the case of foo: , i.e. without the empty string defined? Ansible detects these as None On Friday, 31 January 2014 12:29:11 UTC, Nick Groenen wrote: > > If setting

Re: [ansible-project] Testing for a defined but non empty string

2014-01-31 Thread Nick Groenen
If setting it to an empty string when you don't want it to run is okay for your use case, you could do: when: foo|default("") != "" That will compare against the value of foo when it's defined, and otherwise compare against an empty string. -- Nick Groenen | zoni | @NickGroenen https://zoni.nl |

[ansible-project] Testing for a defined but non empty string

2014-01-31 Thread Stephen Ryan
Best to explain with an example We have tasks setup like - name: do something shell: do task when: foo is defined This works perfectly for most situations however we have a number of places where we need to unset the variable to stop the command on certain hosts. Neither of the following

Re: [ansible-project] Odd message on Amazon Linux

2014-01-31 Thread Peter Gehres
https://groups.google.com/forum/#!topic/ansible-project/2G_BwedPLps/discussion On Thu, Jan 30, 2014 at 8:54 PM, Stan Lemon wrote: > Hello, > I installed ansible on Amazon Linux from EPEL and when I run > ansible-playbook I am seeing the following output: > > 30-Jan-2014 22:28:15 > {"status":1,"