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 the module redirect_list for action plugins #73864
Fix the module redirect_list for action plugins #73864
Conversation
2dedc67
to
63a4ea1
Compare
d1c4f3f
to
6d8c08b
Compare
This comment has been minimized.
This comment has been minimized.
6d8c08b
to
4261a5a
Compare
Fix using unqualified names for facts module in module_defaults
4261a5a
to
ddcec0f
Compare
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.
Maybe give a shot to putting the ansible.legacy
equivalency check in get_action_args_with_defaults- that might obviate the need for all the rest of the changes.
@@ -41,7 +41,16 @@ def _get_module_args(self, fact_module, task_vars): | |||
mod_args = dict((k, v) for k, v in mod_args.items() if v is not None) | |||
|
|||
# handle module defaults | |||
mod_args = get_action_args_with_defaults(fact_module, mod_args, self._task.module_defaults, self._templar, self._task._ansible_internal_redirect_list) | |||
if fact_module == 'ansible.legacy.setup' and self._use_setup_defaults: |
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 think probably all the changes to the actions can go away if you were to change get_action_args_with_defaults to say:
- if
action
is prefixed withansible.legacy.
and the sameansible.legacy
-prefixed action appears in the redirect list, remove the prefix from both places before looping over to apply module_defautls
5886120
to
7d70f08
Compare
… fully qualified ansible.legacy actions ci_complete
7d70f08
to
f3ec6bd
Compare
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.
Fix LGTM- a couple questions/suggestions about the tests, but good to merge either way.
Thanks for the reviews! |
…ansible#73864) * Fix module-specific defaults in the gather_facts, package, and service action plugins. * Handle ansible.legacy actions better in get_action_args_with_defaults * Add tests for each action plugin * Changelog Fixes ansible#72918 (cherry picked from commit 5640093)
…ansible#73864) * Fix module-specific defaults in the gather_facts, package, and service action plugins. * Handle ansible.legacy actions better in get_action_args_with_defaults * Add tests for each action plugin * Changelog Fixes ansible#72918 (cherry picked from commit 5640093)
revert after these patches are shipped in ansible releases: ansible/ansible#73864 ansible/ansible#74850 ansible/ansible#74849
…74850) * Use the module redirect_list when getting defaults for action plugins (#73864) * Fix module-specific defaults in the gather_facts, package, and service action plugins. * Handle ansible.legacy actions better in get_action_args_with_defaults * Add tests for each action plugin * Changelog Fixes #72918 (cherry picked from commit 5640093) * Fix tests for < 3.8 (cherry picked from commit 267b721)
…74849) * Use the module redirect_list when getting defaults for action plugins (#73864) * Fix module-specific defaults in the gather_facts, package, and service action plugins. * Handle ansible.legacy actions better in get_action_args_with_defaults * Add tests for each action plugin * Changelog Fixes #72918 (cherry picked from commit 5640093) * Fix tests for < 3.8
SUMMARY
Fixes #72918
Might separate gather_facts into its own PR or move it to #73863 as it's kind of broken anyway and I'm not sure it should be backported. Fixing it will probably be kind of be featureish for the other action plugins so I'm not sure if that should be backported either. This still needs tests and changelog.I fixed gather_facts without adding anything new by just checking if the source of the value was 'default'.
ISSUE TYPE
COMPONENT NAME
gather_facts
package
service