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
Delegation not properly shown in task #74071
Comments
Files identified in the description: If these files are incorrect, please update the |
There seems to be another callback or have some other options enabled based on the output. Can you provide further details about any configuration changes you may have in place? |
Of course.
As I said output works for ansible 2.9.4 - we have folder on NFS share so ansible.cfg and plays/roles are the same in all cases. Just ansible istallations (binaries/modules) are local. Thank you. |
Thank you. That should be enough for further investigation. |
for some reason delegated vars are not being passed, but in any case we should not need em. index 229728aa22..63e94b8b98 100644
--- a/lib/ansible/plugins/callback/__init__.py
+++ b/lib/ansible/plugins/callback/__init__.py
@@ -105,9 +105,8 @@ class CallbackBase(AnsiblePlugin):
result.
"""
hostname = result._host.get_name()
- delegated_vars = result._result.get('_ansible_delegated_vars', None)
- if delegated_vars:
- return "%s -> %s" % (hostname, delegated_vars['ansible_host'])
+ if result._task.delegate_to:
+ return "%s -> %s" % (hostname, result._task.delegate_to)
return "%s" % (hostname,)
def _run_is_verbose(self, result, verbosity=0):``` |
Summary
When I run a task with the delegation it is not shown properly in the output.
Ansible 2.9.4 actually works ok. Ansible 2.9.17 and 2.9.18 seems broken.
Issue Type
Bug Report
Component Name
delegate_to
Ansible Version
Configuration
OS / Environment
RHEL8
Steps to Reproduce
Expected Results
When delegated task is being run ansible should properly show to which host is task delegated:
Actual Results
The text was updated successfully, but these errors were encountered: