summaryrefslogtreecommitdiff
path: root/lib/ansible/playbook
diff options
context:
space:
mode:
authorSloane Hertel <19572925+s-hertel@users.noreply.github.com>2021-06-24 12:51:03 -0400
committerGitHub <noreply@github.com>2021-06-24 12:51:03 -0400
commit865bda3a11486ea502108381c972b21d91bfe983 (patch)
treed81bf025f465ffb84d47285a55cc8b0156a84496 /lib/ansible/playbook
parenta4021977ad46ef9991d9b41391f60d5d84137209 (diff)
downloadansible-865bda3a11486ea502108381c972b21d91bfe983.tar.gz
Add a resolved_action task attribute (#74709)
* The resolved_action is the formatted version of the final plugin in the PluginLoadContext's redirect_list * Collection plugins are represented as FQCN * Legacy plugins are represented with only the plugin name * Add tests * Changelog
Diffstat (limited to 'lib/ansible/playbook')
-rw-r--r--lib/ansible/playbook/task.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ansible/playbook/task.py b/lib/ansible/playbook/task.py
index b92bd1971b..84c735d6b4 100644
--- a/lib/ansible/playbook/task.py
+++ b/lib/ansible/playbook/task.py
@@ -98,6 +98,7 @@ class Task(Base, Conditional, Taggable, CollectionSearch):
self._role = role
self._parent = None
self.implicit = False
+ self.resolved_action = None
if task_include:
self._parent = task_include
@@ -227,6 +228,7 @@ class Task(Base, Conditional, Taggable, CollectionSearch):
raise AnsibleParserError(to_native(e), obj=ds, orig_exc=e)
else:
self._ansible_internal_redirect_list = args_parser.internal_redirect_list[:]
+ self.resolved_action = args_parser.resolved_action
# the command/shell/script modules used to support the `cmd` arg,
# which corresponds to what we now call _raw_params, so move that
@@ -403,6 +405,7 @@ class Task(Base, Conditional, Taggable, CollectionSearch):
new_me._role = self._role
new_me.implicit = self.implicit
+ new_me.resolved_action = self.resolved_action
return new_me
@@ -421,6 +424,7 @@ class Task(Base, Conditional, Taggable, CollectionSearch):
data['_ansible_internal_redirect_list'] = self._ansible_internal_redirect_list[:]
data['implicit'] = self.implicit
+ data['resolved_action'] = self.resolved_action
return data
@@ -453,6 +457,7 @@ class Task(Base, Conditional, Taggable, CollectionSearch):
self._ansible_internal_redirect_list = data.get('_ansible_internal_redirect_list', [])
self.implicit = data.get('implicit', False)
+ self.resolved_action = data.get('resolved_action')
super(Task, self).deserialize(data)