Excellent! That’s good information, and works really well for my use case.
What I’ve done surprised me a bit b/c naming things is hard. In our local collection (which should be named “local.something” but history happened) I’ve got a module and a filter, both named mw.cc.warn. That seems to work. I guess Ansible can figure out from context which one it should use.
That leads me to wonder: Do you think some day we might [edit have] fully qualified names for collection-scoped variables? For example, mw.cc.rolea.varnamea. We sort of fake it now with mw_cc_rolea_varnamea, but that’s merely a naming convention.
This probably cannot happen as Jinja already uses ‘.’ notation to equate to dictionary keys x.y == x['y'] and Python underneath also uses it for object properties and methods x.keys
Fair enough. What about — and I know we’re blue-skying here — someday perhaps promoting <namespace>_<collection_name>_<foo> beyond a mere naming convention into something real with support at the core level? Granted that we have to overlook the vast chasm of extant names to even entertain the discussion. If we start from the ideal rather than where we currently are, try to imagine how “general qualified naming” would look for everything: collections, roles, plugins, variables, tags, and whatever else I’m forgetting.
For this example I’ll stick with “.” just to facilitate discussion, acknowledging current Jinja issues etc. Consider the unqualified tag “foo”. We all know what that means: it’s a “global” tag, as all tags currently are. A fully qualified tag “nn.cc.rr.foo” would be a “foo” tag scoped to the “rr” role in the “nn.cc” collection. The unqualified tag “foo” would/could match any fully or partially qualified tag ending in “\.?foo$”. But a partially qualified tag “.foo” might match only in the playbook, but not in any local or imported/included roles. Another partially qualified tag “.fee.foo” is scoped to a local “roles/fee” role, but not to any collection roles (as collections assets should always be fully qualified).
I’ve thought about this a lot (although it must look like I’m making this up as I type). No doubt it would need some serious re-thinking to work the same way for “general qualified naming” of everything. Whether there’s a way to build a bridge from here to there is another discussion. [ducks]