# handlers and role dependencies

**URL:** <https://forum.ansible.com/t/handlers-and-role-dependencies/14514>\
**Category:** Ansible Project\
**Created:** [February 6, 2014, 9:32pm UTC](https://forum.ansible.com/t/handlers-and-role-dependencies/14514 "2014-02-06T21:32:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Martin2](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@James\_Martin2](https://forum.ansible.com/u/James_Martin2)\
**Post date:** [February 6, 2014, 9:32pm UTC](https://forum.ansible.com/t/handlers-and-role-dependencies/14514/1 "2014-02-06T21:32:43Z")

</div>

Let’s say I have a role called haproxy which does basic installation and configuration of haproxy.

I’d also have haproxy-riak & haproxy-riakcs roles, which would lay down a configuration file that is tuned for riak and riakcs. These roles would be dependent on haproxy.

Is this a good way to use roles and sub roles? Ideally I’d have subroles for all sorts of configs, but it seems like I’d have to keep similar handlers in each role-- especially for restarting haproxy when a new configuration file is loaded.

I’m guessing there’s no inheritancy in sub-roles (inheriting handlers), so what’s the best way to do that re-use handlers among roles?

- James
