From 18adfc6d1a3b0a8485c5d9310869b89d20cee13c Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Tue, 22 Sep 2015 02:35:01 -0400 Subject: [PATCH] Set some default vars on hosts created for delegate_to connections --- lib/ansible/vars/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/ansible/vars/__init__.py b/lib/ansible/vars/__init__.py index 48c103d124e..aef046fc49a 100644 --- a/lib/ansible/vars/__init__.py +++ b/lib/ansible/vars/__init__.py @@ -315,8 +315,16 @@ class VariableManager: break else: delegated_host = Host(name=delegated_host_name) + delegated_host.vars.update(dict( + ansible_host=delegated_host_name, + ansible_connection = C.DEFAULT_TRANSPORT, + )) else: delegated_host = Host(name=delegated_host_name) + delegated_host.vars.update(dict( + ansible_host=delegated_host_name, + ansible_connection = C.DEFAULT_TRANSPORT, + )) # now we go fetch the vars for the delegated-to host and save them in our # master dictionary of variables to be used later in the TaskExecutor/PlayContext