Skip to content

Commit

Permalink
correctly set delegated host name in results
Browse files Browse the repository at this point in the history
(cherry picked from commit a457c2a)
  • Loading branch information
bcoca committed Jun 20, 2017
1 parent cac3cfa commit 5512c94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ansible/executor/task_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,8 @@ def _evaluate_failed_when_result(result):
# 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
Expand Down

0 comments on commit 5512c94

Please sign in to comment.