Best practices with app/database dependencies

21 views
Skip to first unread message

Strahinja Kustudić

unread,
Sep 18, 2014, 10:13:38 AM9/18/14
to ansible...@googlegroups.com
A lot of applications depend on a database and since databases are used very often, we usually have a separate role for installing a database and a role for installing an application. So if we have two roles: db and app, and app role depends on a database, in which role is it better to created the needed database and possibly the database user which is needed for that app?

Is it better to create it in the db role, e.g. by passing a variable to the db role in the dependency section; or in the app role itself? There are advantages and disadvantages to both of these, but we can discuss them later on.

Michael Peters

unread,
Sep 18, 2014, 10:16:58 AM9/18/14
to ansible...@googlegroups.com
I prefer to have my application role depend on my database role and
then have my application role setup the things it needs like users and
databases. That way my database role is re-usable for other
applications have their own database and user needs.
> --
> 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-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/7827f80e-8ec7-4f8b-aa95-cd58d9eb17bb%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages