I've used role dependencies to address a similar requirement (collectd
in our case).

http://docs.ansible.com/ansible/playbooks_roles.html#role-dependencies

If you make the telegraf role a dependency of the redis role, you'll
have access to vars
set by the telegraf role as well as its handlers by the time the redis
role runs.

you just a need a file roles/redis/meta/main.yml that looks like this:

---
dependencies:
   - { role: telegraf }



On 20 September 2016 at 10:26, Ferdinand Svehla <f.sve...@gmail.com> wrote:
> I am using the roles + site.yml recommended setup.
> Most, but not all boxes run telegraf (a stats collector), which is defined
> as an inventory group as a (tagged) role in site.yml.
>
> In my Redis role, if the current host has the telegraf role I'd like to add
> a file a folder (so Telegraf will pick it up) and refresh the telegraf
> service.
> Here is where it gets tricky - I would basically call out to a different
> role - what is the way to do this in Ansible?
>
> --
> 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/4673802a-da95-4bc4-9c53-ac33c4bc1860%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 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/CAK5eLPTwUOuaz%3DvcyDaeuxNVwoMSQEpqt0ihQUTfFJrbT19hfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to