[ansible-project] Variable combining several lists

2014-03-10 Thread Michael Mahemoff
Is there any way to define a variable as being the combination of several lists. For example, define database_clients as being the combination of all items in groups['app_servers'] and groups['processors']. I'd rather define it once rather than use with_items in different places to combine

Re: [ansible-project] Ansible plugin for FreeIPA

2014-03-10 Thread Johan Söderberg
Yes, I'm thinking of one or more modules that gives the system administrator the ability to do the most basic tasks directly from Ansible. My vision is to automate the whole life cycle chain of a server, from deployment, configuration, administation to decomission. In my environment we are

[ansible-project] regexp in assemble module with remote_src=false

2014-03-10 Thread Marco Corte
If I run this playbook against, say, the host pgli10-nm, it exits with an error --- - hosts: all tasks: - assemble: src=fragments/prova dest=/tmp/prova regexp='({{ ansible_hostname }}|tutti)' mode=644 remote_src=False failed: [pgli10-nm] = {failed:

[ansible-project] Cleaning up after failed ansible run

2014-03-10 Thread Rike-Benjamin Schuppner
Hi, sometimes, ansible fails on a machine and leaves back running but possibly blocking and frozen processes such as /usr/bin/python /root/.ansible/tmp/ansible-tmp-1394441713.94-63420941773266/apt Is there a way to clean up those processes? Also related: Ansible sometimes apparently

Re: [ansible-project] Behavior of ec2_elb module

2014-03-10 Thread Scott Anderson
We're going to use a different means of updating our instances: 1) Update the application AMI offline 2) Change the autoscaler to use the new AMI 3) Gracefully down and kill the old AMI instances in the ELB 4) The ELB will start up new AMI instances as the old ones die 5) Profit! -scott On Mar

Re: [ansible-project] Variable combining several lists

2014-03-10 Thread Brian Coca
you can define in hosts file [database_clients:children] processors app_servers or in other ways groups['processors']|union(groups['app_servers']) -- You received this message because you are subscribed to the Google Groups Ansible Project group. To unsubscribe from this group and stop

[ansible-project] Traverse nested dictionary with keeping the keys

2014-03-10 Thread Robert Verspuy
All, I've tryied to use with_subelements, but this function does not keep the key of the main loop. For example: In host_vars/testserver.yml: --- users: bob: path: /home/users/bob pubkeys: - bob@pc1 - alice@pc2 alice: path: /home/users/alice pubkeys: -

[ansible-project] Re: group_by adding all hosts?

2014-03-10 Thread Matthew R
Hi Brian, Thanks for the tip. I actually tried changing the hyphen to an underscore, but no luck. I think what's happening is that on Linux systems that aren't virtualized, the 'ansible_virtualization_*' facts aren't getting set at all, so the grouping mechanism can't handle it. I'm thinking

[ansible-project] Re: Traverse nested dictionary with keeping the keys

2014-03-10 Thread Robert Verspuy
I made a pull request for this by the way (with a new module): https://github.com/ansible/ansible/pull/6370 Currently limited to only 2 layers, but extra layers can be added fairly easily in the future. Regards, Robert Op maandag 10 maart 2014 14:13:03 UTC+1 schreef Robert Verspuy: All,

Re: [ansible-project] Variable combining several lists

2014-03-10 Thread Michael Mahemoff
That works, thanks. On Monday, March 10, 2014 11:42:06 AM UTC, Brian Coca wrote: you can define in hosts file [database_clients:children] processors app_servers or in other ways groups['processors']|union(groups['app_servers']) -- You received this message because you are

Re: [ansible-project] Re: Traverse nested dictionary with keeping the keys

2014-03-10 Thread Michael DeHaan
Understand your desire for this, though see comments on the ticket. On Mon, Mar 10, 2014 at 10:36 AM, Robert Verspuy rob...@exa.nl wrote: I made a pull request for this by the way (with a new module): https://github.com/ansible/ansible/pull/6370 Currently limited to only 2 layers, but

Re: [ansible-project] Intersections in templates and variables?

2014-03-10 Thread ghexsel
Sorry for necro'ing an old thread, but I'm having a similar problem: I'm playing with an EC2 inventory, and I have several environments, with machines in these environments having a specific class. Is there a way to template the ip of the machine that has both 'tag_environment_myenv' and

Re: [ansible-project] Re: [newbie]Start/stop EC2 instances based on tags

2014-03-10 Thread ghexsel
Just trying to understand: what is your proposed solution for, say 'starting all EC2 VMs that match tag_env_prod in zone US-WEST-1'? | Technically you can, however, use an inventory script and static data at the same time, as long as they are all in a common directory. PS.: BTW, I tried

Re: [ansible-project] Intersections in templates and variables?

2014-03-10 Thread Michael DeHaan
Is there a way to template the ip of the machine that has both 'tag_environment_myenv' and 'tag_class_database'? I don't quite understand what you mean by templating the IP. Can you elaborate a bit more? On Mon, Mar 10, 2014 at 1:06 PM, ghex...@gmail.com wrote: Sorry for necro'ing an

Re: [ansible-project] Re: [newbie]Start/stop EC2 instances based on tags

2014-03-10 Thread Michael DeHaan
| Technically you can, however, use an inventory script and static data at the same time, as long as they are all in a common directory. PS.: BTW, I tried using multiple inventory files but it didn't work with ansible.cfg, only with the -i param. Please file a ticket if you can't set the

Re: [ansible-project] Intersections in templates and variables?

2014-03-10 Thread Michael DeHaan
Tags become groups as you can test by running ./ec2.py --list So generically, in Ansible You can do things like: when: inventory_hostname in groups.foo and inventory_hostname in groups.bar or you can just specify this in your host specificaition: hosts: group1:group2 On Mon, Mar 10,

[ansible-project] Ansible and AWS ASG?

2014-03-10 Thread Timothy Perrett
Hey all, Is there any support / module in ansible for creating auto-scalling groups within amazon? Or should I just use the shell command and invoke the AWS CLI? Thanks, Tim PS: I love ansible so far, its really great -- You received this message because you are subscribed to the Google

Re: [ansible-project] Ansible and AWS ASG?

2014-03-10 Thread Matt Martz
You will likely be interested in the following pull request: https://github.com/ansible/ansible/pull/6233 --  Matt Martz m...@sivel.net On March 10, 2014 at 1:28:31 PM, Timothy Perrett (tperr...@gmail.com) wrote: Hey all, Is there any support / module in ansible for creating auto-scalling

Re: [ansible-project] Ansible and AWS ASG?

2014-03-10 Thread Michael DeHaan
Yep, I was very excited to see this! We're going to be making a strong push to close a lot of the cloud PRs in the coming week or two. On Mon, Mar 10, 2014 at 2:30 PM, Matt Martz m...@sivel.net wrote: You will likely be interested in the following pull request:

[ansible-project] Can't limit hosts to run with hosts: WEB[:1] in Ansible 1.5

2014-03-10 Thread t goto
Dear Ansible experts and developers. Hello, I've got one question regarding Ansible1.5 . I've been using [:number] in hosts section of playbook so that I can limit the number of server to run. Below is an example. WEB group consists from 3 servers .. [WEB] server01 server02 server03 and I

[ansible-project] recommended strategy for assembling roles dir from shared roles

2014-03-10 Thread Jonathan Sabo
What are some good ways to automate pulling down shared roles from Galaxy or shared github repos? How are people doing that today? Are you scripting ansible-galaxy or do tools like librarian-whatever exist? What's the best way to go about this? Thanks, Jonathan -- You received this

Re: [ansible-project] recommended strategy for assembling roles dir from shared roles

2014-03-10 Thread Michael DeHaan
So galaxy already supports a requirements file: IIRC ansible-galaxy install -f filename where the file is username.rolename[,version] username.rolename etc When starting this I had posted in the beginning I think I had said I'm totally open to upgrades inspired from other tooling and want to

[ansible-project] Selecting Host in Multiple Groups

2014-03-10 Thread James Goodhouse
Hey All, How would one go about targeting hosts based on being them being in multiple groups? For example, I have a staging inventory file with a Vagrant group and a Japan group. I want to target a vagrant server that is also in the Japan group, but don't want the Japan hosts that aren't in

Re: [ansible-project] Ansible and AWS ASG?

2014-03-10 Thread Timothy Perrett
Awesome, thanks for the pointer. When this stuff is merged will there be a milestone release or similar? Just trying to see when I could get a hold of this good stuff :-) I'm not a python guy, so I'm not sure if I'm missing something: perhaps there's a way to try if out now? Cheers Sent

Re: [ansible-project] Ansible and AWS ASG?

2014-03-10 Thread Michael DeHaan
When this stuff is merged will there be a milestone release or similar? Just trying to see when I could get a hold of this good stuff :-) No, but lots of folks like to run straight off the development branch, and this helps us a ton with testing. source ./hacking/env-setup from a checkout and

Re: [ansible-project] Selecting Host in Multiple Groups

2014-03-10 Thread James Goodhouse
That would be a group in the inventory file, correct? Is there a way to do it via the -l flag? On Monday, March 10, 2014 12:38:09 PM UTC-7, Serge van Ginderachter wrote: On 10 March 2014 20:28, James Goodhouse jamg...@gmail.com javascript:wrote: How would one go about targeting hosts

Re: [ansible-project] Re: [newbie]Start/stop EC2 instances based on tags

2014-03-10 Thread ghexsel
Ah, thank you very much, this indeed allowed me to shut down all instances in an environment (code pasted below if anyone ever needs to google this). Unfortunately, shutdown didn't work because ec2.py doesn't seem to list stopped instances (even after --refresh-cache). Thank you both.

Re: [ansible-project] Re: [newbie]Start/stop EC2 instances based on tags

2014-03-10 Thread ghexsel
Sorry, Unfortunately, shutdown didn't work... should read Unfortunately, starting 'stopped' instances didn't work On Monday, March 10, 2014 2:19:54 PM UTC-7, ghe...@gmail.com wrote: Ah, thank you very much, this indeed allowed me to shut down all instances in an environment

[ansible-project] Super quick and short survey - Help us understand where you download Ansible from

2014-03-10 Thread Michael DeHaan
Hi guys, Super quick question we have -- wanted to know how people are downloading Ansible. There are also two related questions attempting to categorize whether respondents are new or old users (as that might affect preferences? Maybe not), and whether we're trending more towards dev or ops

Re: [ansible-project] Where is ansible_fqdn coming from?

2014-03-10 Thread Matt Martz
It comes from the socket python module: https://github.com/ansible/ansible/blob/release1.5.0/library/system/setup#L165 Which does sort of the following: Get the hostname of the server: python -c import socket; print socket.gethostname() Use that value to get the host by address: python -c

Re: [ansible-project] Timing issue, installing a package and then modifying one of it's files...

2014-03-10 Thread Adam Morris
My stupidity was at fault... There is originally a commented out line in the file that ALSO matches the regexp I was using. So, my change was made to the second of two matching lines and not the first... Kind of confusing when using insertbefore... So I have... example line 1 # line 2

[ansible-project] Ansible 1.5.1 released: security updates

2014-03-10 Thread Michael DeHaan
Ansible 1.5.1 Release Notes Today we're releasing Ansible 1.5.1 which contains three security fixes/upgrades as well as a few assorted bugfixes that have been applied since the 1.5 release. An upgrade is suggested for all users using vault, interacting with web-properties over https://, or

[ansible-project] with_nested combined with with_sequence and with_fileglob ?

2014-03-10 Thread RobL
Hi: I'd like to do a nested loop over a sequence and a file glob. A simplified example of what I thought might work is: - command: cp {{ item[1] }} {{ item[1] }}.{{ item[0] }} with_nested: - with_sequence: start=0 end=10 - with_fileglob: - /etc/* However, this syntax doesn't

Re: [ansible-project] nested with_fileglob and with_sequence

2014-03-10 Thread Michael DeHaan
So with_fileglob works locally. The sequence idea would generate a range of 1-10, but I'm having a bit trouble modelling your end to end use case and may be able to suggest something better. Can you explain what the above sytntax would do and return? Thanks! On Mon, Mar 10, 2014 at 7:57 PM,

Re: [ansible-project] regexp in assemble module with remote_src=false

2014-03-10 Thread James Cammarata
This is a bug, the action_plugin version (which runs locally) doesn't accept the regexp parameter. Could you please open a github issue for this? Thanks! On Mon, Mar 10, 2014 at 5:36 AM, Marco Corte marcoc...@gmail.com wrote: If I run this playbook against, say, the host pgli10-nm, it exits