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
fix loading vars_plugins in roles #82273
fix loading vars_plugins in roles #82273
Conversation
use vars_loader as the source of truth by changing it to an ordered dict ci_complete
…n't cache in all()
5ebc1e7
to
a97f73b
Compare
0de2af4
to
5b413e5
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Simplify, comment code
if vars_loader._paths is None: | ||
# cache has been reset, reload all() | ||
_prime_vars_loader() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used vars_loader._paths here as opposed to (for example) vars_loader._search_paths because I'm assuming we don't want to extend OLD_PLUGIN_CACHE_CLEARING
to new caches.
I moved this into the vars plugin loader too. <- Actually can't, it duplicates any stateless enabled plugins.
1697252
to
3711be8
Compare
* Fix loading legacy vars plugins when the plugin loader cache is reset * Remove extra cache layer by ensuring vars plugin names are cached (stateless or not) so that the plugin loader cache can double as the load order (cherry picked from commit 13e6d84)
* Fix loading legacy vars plugins when the plugin loader cache is reset * Remove extra cache layer by ensuring vars plugin names are cached (stateless or not) so that the plugin loader cache can double as the load order (cherry picked from commit 13e6d84)
SUMMARY
Fixes #82239
Adding a new role dir to the plugin loader clears the plugin loader cache, but the variable
cached_vars_plugin_order
in ansible.vars.plugins is never reset, preventing new plugins from being found.Remove cache in the middle and use the vars plugin loader cache as the load-order. To make this possible, the cache keys now include non-stateless vars plugins (the value is a None, unresolved PluginLoadContext() tuple to be easily distinguished from stateless plugins).
ISSUE TYPE
ADDITIONAL INFORMATION