summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBrian Coca <brian.coca+git@gmail.com>2017-06-20 20:56:52 +0200
committerBrian Coca <brian.coca+git@gmail.com>2017-06-20 20:58:43 +0200
commita457c2af59b6b64e66d8e45a64e4a59c35e629a8 (patch)
tree5030a85c178f74ee4b9de047202517b5ea46567e /lib
parentadjust script caching to processed data (diff)
downloadansible-a457c2af59b6b64e66d8e45a64e4a59c35e629a8.tar.xz
ansible-a457c2af59b6b64e66d8e45a64e4a59c35e629a8.zip
correctly set delegated host name in results
Diffstat (limited to 'lib')
-rw-r--r--lib/ansible/executor/task_executor.py4
1 files 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