Here's an example of how we lay out our ansible project directory. We have
a tomcat-based app and we create an RPM for the "common" portions of the
app that live outside of the WAR file to be installed (log dir, extra libs,
etc), and keep the WAR and the config files specific to each inst-env pair
inside of the files/env/inst-env directory.

https://gist.github.com/BradGunnerSGT/ba1cea6c6629a702f9eb

Using the group_vars we can specify a different version of the application
to be installed onto each environment (to test new versions, for example),
and even a different revision of the RPM.

----
Mark McCoy <http://markmccoy.us>



On Thu, Aug 28, 2014 at 3:31 AM, Jordi Funollet <funol...@fastmail.fm>
wrote:

>  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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/1409214674.1310501.157687269.4E51BB12%40webmail.messagingengine.com
> <https://groups.google.com/d/msgid/ansible-project/1409214674.1310501.157687269.4E51BB12%40webmail.messagingengine.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAP2%3DG9P6wD1FwaS5A87M72L5v4rh7%2BLKfk-nkb2heMvr106yHA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to