-
Notifications
You must be signed in to change notification settings - Fork 23.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better defined namespace handling #69195
Comments
Files identified in the description: If these files are incorrect, please update the |
The behavior you are seeing above is expected. You have defined
This implicitly becomes:
Which puts the search order of If you want
Because of the this behavior, I've always felt like it was a mistake for collection authors to strip prefixes from their modules, that would cause their modules to shadow internal ansible module names. I'm also a firm believer, that playbooks should ultimately be written to use the FQCN of the module, and shy away from using |
Thanks, I pretty much agree with everything above. However, in line with using FQCNs everywhere, it seems appropriate that when ansible implicitly loads the setup module as part of the "Gathering facts" step that it explicitly calls ansible.legacy.setup (or whatever is appropriate for it). |
Overriding modules is an acceptable use case. |
Per the above discussion, we're going to go ahead and close this. If you have any further questions, please let us know by stopping by one of the two mailing lists, as appropriate:
Because this project is very active, we're unlikely to see comments made on closed tickets, but the mailing list is a great way to ask questions, or post if you don't think this particular issue is resolved. Thank you! |
SUMMARY
The use of collections and adding collection names to the module search path creates the possibility of module name collisions between collections and core and between various collections. It would be good to define the expected behavior as much as possible. It may also be required to have a namespace for the core modules (if there isn't one already) and have ansible's core module/configuration refer to those FQCNs to avoid using versions from collections.
I'm likely going to rename the pfsensible.core modules to not conflict with core modules, but I still think this is worth documenting and possibly fixing.
ISSUE TYPE
COMPONENT NAME
ansiballz
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Fedora Rawhide
STEPS TO REPRODUCE
Install the pfsensible.core collection:
Run this play:
EXPECTED RESULTS
ansible collects system facts with the core setup module, then runs the pfsensible.core user module.
ACTUAL RESULTS
ansiballz ships and runs the pfsensible.core setup module. Users has not yet been tested.
The text was updated successfully, but these errors were encountered: