From a457c2af59b6b64e66d8e45a64e4a59c35e629a8 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 20 Jun 2017 14:56:52 -0400 Subject: [PATCH] correctly set delegated host name in results --- lib/ansible/executor/task_executor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index 8d0a399c74..7f8437cc00 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -627,8 +627,8 @@ class TaskExecutor: # there is another source of truth we can use delegated_vars = variables.get('ansible_delegated_vars', dict()).get(self._task.delegate_to, dict()).copy() if len(delegated_vars) > 0: - result["_ansible_delegated_vars"] = dict() - for k in ('ansible_delegated_host', 'ansible_host'): + result["_ansible_delegated_vars"] = {'ansible_delegated_host': self._task.delegate_to} + for k in ('ansible_host', ): result["_ansible_delegated_vars"][k] = delegated_vars.get(k) # and return