mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Enlarge scope of 'ansible_ssh_user' magic variable
Allow to use ansible_ssh_user variable in `sudo_user` or `when` clauses
This commit is contained in:
parent
240d7bf197
commit
48fe7ac19d
1 changed files with 1 additions and 0 deletions
|
@ -378,6 +378,7 @@ class Runner(object):
|
||||||
inject = utils.combine_vars(inject, host_variables)
|
inject = utils.combine_vars(inject, host_variables)
|
||||||
inject = utils.combine_vars(inject, self.module_vars)
|
inject = utils.combine_vars(inject, self.module_vars)
|
||||||
inject = utils.combine_vars(inject, self.setup_cache[host])
|
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['hostvars'] = HostVars(self.setup_cache, self.inventory)
|
||||||
inject['group_names'] = host_variables.get('group_names', [])
|
inject['group_names'] = host_variables.get('group_names', [])
|
||||||
inject['groups'] = self.inventory.groups_list()
|
inject['groups'] = self.inventory.groups_list()
|
||||||
|
|
Loading…
Reference in a new issue