[ansible-project] Can somebody help me understand hostvars and jinja's intersect?

2016-11-18 Thread Dan Rough
Hi, I have two testing environments, located in different regions. Within each of those environments, among all the servers, there is a monitoring server. In one of my ansible roles I would like to be able to select the ip address of the relevant monitoring server. I thought that I could use a

Re: [ansible-project] Re: Getting hostvars from an intersection of groups

2016-10-28 Thread Dan Rough
Thanks Josh. That's useful to know about. I have one of the situations that the README describes - I have some kit at Rackspace, and some on a dedicated server elsewhere. At the moment, I store all the inventory files in a directory, inventories. When I run a playbook I provide the directory

Re: [ansible-project] Re: Getting hostvars from an intersection of groups

2016-10-28 Thread Dan Rough
makes the selection clearer to read which is a bonus too. Hope this helps someone else. On Friday, 28 October 2016 19:09:12 UTC+1, Dan Rough wrote: > > Mehul / Karen, > > Did you ever get anywhere with this? I have just arrived at the same > problem and am looking for a solution too.

Re: [ansible-project] Re: Getting hostvars from an intersection of groups

2016-10-28 Thread Dan Rough
Mehul / Karen, Did you ever get anywhere with this? I have just arrived at the same problem and am looking for a solution too. When I run: ansible prod -i ./inventories/rax.py -c local -m debug -a var="{{

Re: [ansible-project] Re: group_vars and ansible's patterns - suggestions please!

2016-10-27 Thread Dan Rough
on how I manage vars/ today > https://github.com/linuxdynasty/ansible-examples/tree/master/playbooks > >> On Wednesday, October 26, 2016 at 1:39:21 PM UTC-7, Dan Rough wrote: >> Hi, >> >> I'd like to know how others are dealing with keeping their group_vars files

Re: [ansible-project] Re: group_vars and ansible's patterns - suggestions please!

2016-10-26 Thread Dan Rough
pull the values you need > for any given server based on its key? > > Alex > >> On Wednesday, October 26, 2016 at 1:39:21 PM UTC-7, Dan Rough wrote: >> Hi, >> >> I'd like to know how others are dealing with keeping their group_vars files >> granular. Ours ha

[ansible-project] Re: Question about organizing roles and playbooks

2016-10-26 Thread Dan Rough
If I understand your question correctly, then why not just have two playbooks? We have an infrastructure.yml playbook which provisions a server for us. We also have another playbook which makes alterations to that server dependent on its role. For example, in our case when we provision a

[ansible-project] group_vars and ansible's patterns - suggestions please!

2016-10-26 Thread Dan Rough
Hi, I'd like to know how others are dealing with keeping their group_vars files granular. Ours have become a little unwieldily and we're considering approaches to breaking them apart. When we provision a server, we assign it to a number of groups. Among those groups, each server is added to

[ansible-project] Creating servers at Rackspace, host specification and where best to store group variables

2016-07-12 Thread Dan Rough
Hi, We use ansible to create servers at Rackspace. We rely on rax.py to provide the inventory of the current server configuration. Currently, the play that creates the required servers this looks like this: - name: "Create infrastructure" hosts: localhost vars: network_name: "{{

Re: [ansible-project] Update Ansible SSH Address Mid-Playbook

2016-02-26 Thread Dan Rough
incorrectly. Thanks! Dan. On 26 February 2016 at 15:09, Dan Rough <d...@gamevy.com> wrote: > Hi Liam, > > Thanks for responding - I'd all but given up on getting this to work. > > I'm using Rackspace rather than AWS, I'll see if the Rackspace equivalent, > rax.py has a simi

Re: [ansible-project] Update Ansible SSH Address Mid-Playbook

2016-02-26 Thread Dan Rough
e_max_age = 0 in the ec2.ini file. > > This was the issue for me, so maybe it'll help you. > > Cheers, > Liam > > On Sunday, 7 February 2016 04:54:02 UTC+8, Dan Rough wrote: >> >> Rather than post a new thread, I thought that I would resurrect this one, >> as Brian's su

Re: [ansible-project] Update Ansible SSH Address Mid-Playbook

2016-02-06 Thread Dan Rough
Rather than post a new thread, I thought that I would resurrect this one, as Brian's suggestion - to use `meta: refresh_inventory` sounds to be exactly what I'm looking for. However, after some number of attempts, I can not seem to get it to work. Does anyone have an example that they wouldn't

[ansible-project] Reporting on dry run package updates

2015-12-08 Thread Dan Rough
Hi, On a weekly basis I upgrade any packages for which there are available updates on our servers. I first perform this in our test environment, and then once happy with those changes, in our production environment. Though it's not a massive task, I have started to look at how I could do this

Re: [ansible-project] Use rax module to create a server with extra_create_args / build_config

2015-04-15 Thread Dan Rough
at 5:45 AM, Dan Rough dan.ro...@gmail.com wrote: Hello, I'd like to be able to create servers at Rackspace which are free from any packages other than the ones installed by default as part of a Debian installation. In response to the support ticket I raised, I was pointed to this article

[ansible-project] Use rax module to create a server with extra_create_args / build_config

2015-04-14 Thread Dan Rough
Hello, I'd like to be able to create servers at Rackspace which are free from any packages other than the ones installed by default as part of a Debian installation. In response to the support ticket I raised, I was pointed to this article in Rackspace's documentation:

Re: [ansible-project] Gathering facts about servers newly created using the rax modules and dynamic inventory

2015-01-19 Thread Dan Rough
in http://docs.ansible.com/guide_rax.html On Mon, Jan 19, 2015 at 10:34 AM, Dan Rough dan.ro...@gmail.com wrote: Hi, Thanks for your response Tom, it got me further down the path but I'm running into problems elsewhere. Though adding the hosts to the in memory inventory using add_host

[ansible-project] Gathering facts about servers newly created using the rax modules and dynamic inventory

2015-01-16 Thread Dan Rough
Hi there, I'd like to understand how I can access a set of newly created rackspace servers using the group names that I specified at the point of creation. At the moment, parts of my playbook are being ignored because the groups the new servers are added to at the point of creation are not

Re: [ansible-project] Pass parameter/argument to (generic) template

2013-11-27 Thread Dan Rough
Hi there, We were faced with what seems like a similar problem recently. I couldn't find any information online about how to solve it, but was lucky enough to be given a pointer by somebody on the IRC channel. I thought that I would blog our solution so that it's available for others faced

[ansible-project] Iterating over a template: task with a list of dictionary objects?

2013-11-26 Thread Dan Rough
Hi there, I'd like to be able to start 3 services that I am deploying by iterating over one generic template that I have for them. Is it possible to pass variables through to the template task using with_items and a dictionary of variables? I had hoped that I'd be able to use something like