On Thu, Aug 28, 2014, at 04:03 AM, Brian Coca wrote:
> hosts can be in more than one group. all hosts in the
production file
> should be in production group, but you can also have hosts in
dbservers
> group.
Agree. So when targeting hosts we can use the inventory as
environment and --limit to restrict to a specific group in this
environment.
$ ansible-playbook -i inventory/stage -l dbservers
But what about vars? Both vars in group_vars/stage and
group_vars/dbservers would apply for these hosts. But I can't
see a way to set a value for dbservers in stage and another
for dbservers in production. Most cases could be addressed
without this level of granularity, but I would like to know if
there's some way to achieve this.
And which one takes precedence? I assume groups are sorted
alphabetically (are they?) so we should use some naming trick
to guarantee that environments vars are consistently selected
after (or before) "regular groups" vars.
$ python -c 'import string ; print
"".join(sorted(string.printable))'
!"#$%&'()*+,-./0123456789:;<=>?@
ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
Prepending ~ to environment names sounds like a good way to
give them less weight than "regular groups".
--
Jordi Funollet Pujol
http://www.linkedin.com/in/jordifunollet
--
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/1409214674.1310501.157687269.4E51BB12%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.