handlers and role dependencies

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