Re: [ansible-project] Best practice for referring to other host IPs

2014-06-04 Thread Michael Mahemoff
, Michael Mahemoff mic...@mahemoff.com javascript: wrote: I know this has come up before, but I've not come across a real answer for it. It's common for a given host to depend on other hosts. App servers need to know the IP of databases they consume, databases need to know IPs of app servers

[ansible-project] Reusing inventory config

2014-06-03 Thread Michael Mahemoff
As I have separate staging and production inventory files, I end up duplicating some group compositions (e.g. databases:children is mysql:children and redis:children, that kind of thing). I'm wondering if there's a way to consolidate that logic, such as a directive to include a file. Or maybe

[ansible-project] Best practice for referring to other host IPs

2014-06-03 Thread Michael Mahemoff
I know this has come up before, but I've not come across a real answer for it. It's common for a given host to depend on other hosts. App servers need to know the IP of databases they consume, databases need to know IPs of app servers that will be accessing them etc etc. In Ansible, the IP of

[ansible-project] Aborting playbook execution during rolling updates?

2014-03-31 Thread Michael Mahemoff
I have parallel hosts configured with serial to ensure rolling updates. But if one fails, I believe the next one will unconditionally still execute, causing the whole cluster to fail. Is there any way to abort the entire playbook execution (or that for serial hosts anyway) if any one host

Re: [ansible-project] Aborting playbook execution during rolling updates?

2014-03-31 Thread Michael Mahemoff
://github.com/ansible/ansible/blob/devel/docsite/rst/playbooks_delegation.rst#maximum-failure-percentage On Mon, Mar 31, 2014 at 3:07 PM, Michael Mahemoff mic...@mahemoff.comjavascript: wrote: I have parallel hosts configured with serial to ensure rolling updates. But if one fails, I believe

[ansible-project] Default variables in with_items dict

2014-03-26 Thread Michael Mahemoff
I have a line like this, where configs variable is defined as a list of dicts/hashes: template: src={{ item.name }}.j2 dest=/etc/config/{{ item.target_name|item.name }} with_items: configs It basically allows the generated filename to be customised, but fall back to the template name if none

[ansible-project] Re: Default variables in with_items dict

2014-03-26 Thread Michael Mahemoff
for an item dict, as item.target_name is still undefined on the next task. On Wednesday, March 26, 2014 10:24:24 AM UTC, Michael Mahemoff wrote: I have a line like this, where configs variable is defined as a list of dicts/hashes: template: src={{ item.name }}.j2 dest=/etc/config/{{ item.target_name

Re: [ansible-project] Re: Default variables in with_items dict

2014-03-26 Thread Michael Mahemoff
, but seems that set_fact doesn't work as I expected for an item dict, as item.target_name is still undefined on the next task. On Wednesday, March 26, 2014 10:24:24 AM UTC, Michael Mahemoff wrote: I have a line like this, where configs variable is defined as a list of dicts/hashes: template

[ansible-project] Re: Run a logging task after Playbook ends?

2014-03-16 Thread Michael Mahemoff
Thanks everyone, I'm glad there's a mechanism for this and I'll definitely test-run Matt's new plugin. On Saturday, March 15, 2014 10:15:53 PM UTC, Michael Mahemoff wrote: Is there any way to run a command after the playbook has finished running, so it would run once no matter how many hosts

[ansible-project] Run a logging task after Playbook ends?

2014-03-15 Thread Michael Mahemoff
Is there any way to run a command after the playbook has finished running, so it would run once no matter how many hosts were processed? Kind of a callback handler or super-notifier. I have a Hipchat message generated after deploying and I'd rather see one summary message than a line for each

[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] 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] Looping through a group's IP numbers

2014-03-05 Thread Michael Mahemoff
['webservers'] -- Matt Martz ma...@sivel.net javascript: On March 4, 2014 at 3:09:35 PM, Michael Mahemoff (mic...@mahemoff.comjavascript:) wrote: I have a rule like this: - name: Create user mysql_user: name=app host=={{ item

Re: [ansible-project] Specify host for a playbook task

2014-03-03 Thread Michael Mahemoff
Thanks! On Monday, March 3, 2014 8:59:06 PM UTC, Adam Heath wrote: delegate_to: On 03/03/2014 02:51 PM, Michael Mahemoff wrote: Is there any way to override the current host for a given task? I want to set up a recurring database copy, so I need to run some commands within

[ansible-project] Re: apt-key with HKP keyserver

2014-03-01 Thread Michael Mahemoff
. Adam On Friday, February 28, 2014 12:03:05 PM UTC-8, Michael Mahemoff wrote: I'm trying to follow the instructions for installing MaraDB apt package ( https://downloads.mariadb.org/mariadb/repositories/#distro=Ubuntudistro_release=preciseversion=5.5). It proposes to add a key like this: sudo

[ansible-project] apt-key with HKP keyserver

2014-02-28 Thread Michael Mahemoff
I'm trying to follow the instructions for installing MaraDB apt package (https://downloads.mariadb.org/mariadb/repositories/#distro=Ubuntudistro_release=preciseversion=5.5). It proposes to add a key like this: sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80