summaryrefslogtreecommitdiff
path: root/lib/ansible/playbook
diff options
context:
space:
mode:
authorSloane Hertel <19572925+s-hertel@users.noreply.github.com>2022-06-08 12:29:20 -0400
committerGitHub <noreply@github.com>2022-06-08 11:29:20 -0500
commit63a086023150c41f8150385896284f87c0778639 (patch)
tree67f57de3592861a74f20e2ceaeb86aad18c0ae39 /lib/ansible/playbook
parentf80f58903bb7b74880968431f80b1ea48104f5cb (diff)
downloadansible-63a086023150c41f8150385896284f87c0778639.tar.gz
Add toggle to fix module_defaults with module-as-redirected-action on a per-module basis (#77265) (#77899)
* If there is a platform specific handler, prefer the resolved module over the resolved action when loading module_defaults Add a toggle for action plugins to prefer the resolved module when loading module_defaults Allow moving away from modules intercepted as actions pattern Fixes #77059 (cherry picked from commit 621e782ed0c119d2c84124d006fdf253c082449a)
Diffstat (limited to 'lib/ansible/playbook')
-rw-r--r--lib/ansible/playbook/base.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/ansible/playbook/base.py b/lib/ansible/playbook/base.py
index 4bd5a7c287..e8cfe741b6 100644
--- a/lib/ansible/playbook/base.py
+++ b/lib/ansible/playbook/base.py
@@ -507,9 +507,13 @@ class FieldAttributeBase(metaclass=BaseMeta):
return fq_group_name, resolved_actions
def _resolve_action(self, action_name, mandatory=True):
- context = action_loader.find_plugin_with_context(action_name)
- if not context.resolved:
- context = module_loader.find_plugin_with_context(action_name)
+ context = module_loader.find_plugin_with_context(action_name)
+ if context.resolved and not context.action_plugin:
+ prefer = action_loader.find_plugin_with_context(action_name)
+ if prefer.resolved:
+ context = prefer
+ elif not context.resolved:
+ context = action_loader.find_plugin_with_context(action_name)
if context.resolved:
return context.resolved_fqcn