Just apply both roles to your mongodb group, and if you want to be explicit
you'd just set some vars on that group that both roles can use to find
paths etc.


On 31 January 2017 at 13:35, Rui Goncalves <[email protected]> wrote:
> Hi all,
>
> I have no experience writing ansible roles. At the moment I'm trying to
> write a few ansible roles, but I'm not sure how to separate
> responsibilities.
>
> I have two roles.
> - prometheus - installs and configures prometheus.
> - mongodb - Installs and configures mongodb database.
>
> Prometheus needs to be configured in order to scrap metrics about mongoDB.
> Basically, it's necessary to put a file on a directory where the prometheus
> server is installed, containing information about mongodb location, etc...
> the question is: Should I configure this on the prometheus role? It seems to
> me that I'm polluting the prometheus role with things that belong elsewhere.
> This way, I'm also coupling the prometheus role with a specific use case.
> It's recommended to create a separate role to configure mongodb location on
> prometheus?
>
> What's the best practice?
>
> Thanks,
> Rui
>
>
>
>
>
> --
> 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/744a004e-8c85-407c-9f29-e255d1a2dce0%40googlegroups.com.
> 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 [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/CAK5eLPRuGZCLUjZzHHsCEXHonEUc8cdWN%2BOCXpxiLoP8DqohmQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to