diff options
author | Sloane Hertel <19572925+s-hertel@users.noreply.github.com> | 2021-06-24 12:51:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-24 12:51:03 -0400 |
commit | 865bda3a11486ea502108381c972b21d91bfe983 (patch) | |
tree | d81bf025f465ffb84d47285a55cc8b0156a84496 /lib/ansible/playbook | |
parent | a4021977ad46ef9991d9b41391f60d5d84137209 (diff) | |
download | ansible-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.py | 5 |
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) |