Yes, it’s perfectly valid to pass a path as the role name, which allows you to more easily keep a common directory for your roles rather than requiring they be located in the same directory as the playbook.
It’s beside the point, but I really don’t like role dependencies in ansible - they were needed to end particular academic mailing list discussions about composability, and I think they are appropriate in some cases, but in MOST cases they overcomplicate setup.
It would usually be easier to just list roles that need to run first ahead of other roles, and that way the list is more clearly shown in the playbook, rather than somewhat obfuscated in terms of order. Still, they aren’t going away.
All being said, tagging a role should tag the dependent roles - if that appears to not be working, definitely file a bug on GitHub for it.
I see you point and I guess it should be improve the execution time to define a role once before the others rather than having each role check its dependency even if it is idempotent.
I think the idea was that each role would be more encapsulated and that it ought to define the dependencies instead of somebody else having to work it out.
I solved my initial problem by ensuring that all my shared roles reference the directory they were packaged in. Instead of defining it in the project that imports it.
All works fine and yes the tagging works perfectly.
I see you point and I guess it should be improve the execution time to
define a role once before the others rather than having each role check its
dependency even if it is idempotent.
I think the idea was that each role would be more encapsulated and that it
ought to define the dependencies instead of somebody else having to work it
out.
There is already the "allow_duplicates" setting in Ansible that will
prevent a role from being loaded more than once, if called from the same
parameters.