>
> I've got a similar issue that would be solved by inventory variables 
> having a higher precedence.
>

We have several environments, e.g. test, dev, preprod etc.  They use the 
same roles and groups - web, app, db etc.
But there are some things per environment that vary.  For example, as we're 
deploying to AWS we might want to create an environment across multiple 
availability zones or just in a single zone.  Or we might want it to be on 
a single host.
e.g. the default 'zones' is 'a', but our prod would want 'zones' to be 
a,b,c.
We define each environment via AWS tags, and so we have a separate 
inventory directory for each environment, each searching for a specific tag.

If we put our per-environment vars in 
~/inventory/xxx/group_vars/all/all.yml then they'll be overridden by  vars 
in ~/group_vars/all/all.yml.   So all environments would pick up just 'a' 
for 'zones'.

We could of course have a ~/group_vars/xxx/  directory for each environment 
based on tags returned by AWS (e.g. ~/group_vars/tag_prod).  But that's 
only picked up and applied to hosts within that group, which means that the 
scripts that actually provision the environment don't pick up the per-env 
variables (as there aren't any hosts until they're provisioned).

So in cases like this it would be very useful to be able to give inventory 
variables a higher precedence than group variables.


 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/45b51fad-8f3e-444f-bfaf-160ec98ff25f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to