Dependency to a role used in distinct hosts

Hi all,

If I’ve understood correctly, role dependencies are to run in the same hosts. At least this seems to be the design. But I have many cases where dependencies are to roles that will run in other groups of hosts.

Ex.: roles to a group dbservers and roles to a group appservers - many of the roles of the appservers have the roles applied in the dbservers as dependencies.

What I would like is to define a dependency in a role that runs in a host / group, but this dependency must run in another host / group.

A simple reorganization of the playbook does not seem enough. Right now the best I was able to do is the reordering of dependencies in the playbooks, but this does not scale. The dependencies are too many and too entangled. Think hundreds microservices being deployed with database dependencies in many different hosts / groups, some with the same dependencies and some dependencies linked to more than one service.

Are there some best practices / planned feature to accomplish this?

Thanks,

Paulo Suderio