Re: [ansible-project] access inventory file name

2014-05-13 Thread Michael DeHaan
But looks like the variable file is referred to, before the variable inventory_file is loaded? I'm not sure what this means, can you elaborate? Thanks! On Mon, May 12, 2014 at 3:27 PM, Mridusmita Talukdar mridu...@gmail.comwrote: Hi, We have multiple clusters. Each of the clusters need to

Re: [ansible-project] access inventory file name

2014-05-12 Thread Mridusmita Talukdar
Hi, We have multiple clusters. Each of the clusters need to have a different var file (cluster specific variables) Currently the variable file name is same as the cluster name, so that when the extra-variable says cluster=ABC, my playbook picks up the variable file ABC.yml which I refer to in

[ansible-project] access inventory file name

2014-05-05 Thread Drew Gulino
As suggested in the best practices doc, have two inventory files: qa and production I call these using the -i parameter: ansible-playbook -i qa ... Is there a way I can determine in my playbook which inventory I am using? The use case is I want to notify one chat room if using qa inventory,

Re: [ansible-project] access inventory file name

2014-05-05 Thread James Cammarata
The name of the current inventory file in use is stored in the inventory_file variable name, so you could check that. Beyond that, there are two other options: 1. Use --extra-vars to specify the target environment, for example: --extra-vars=inventory=qa 2. The group_vars location is based on the