Merge pull request #3250 from gildegoma/more_magical_ansible_ssh_user

Make 'ansible_ssh_user' available in templates
This commit is contained in:
Michael DeHaan 2013-06-18 17:08:29 -07:00
commit 7193ff5fbf

View file

@ -381,6 +381,7 @@ class Runner(object):
inject = utils.combine_vars(inject, host_variables)
inject = utils.combine_vars(inject, self.module_vars)
inject = utils.combine_vars(inject, self.setup_cache[host])
inject.setdefault('ansible_ssh_user', self.remote_user)
inject['hostvars'] = HostVars(self.setup_cache, self.inventory)
inject['group_names'] = host_variables.get('group_names', [])
inject['groups'] = self.inventory.groups_list()