mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge branch 'devel' of https://github.com/dparalen/ansible into dparalen-devel
This commit is contained in:
commit
6c25e78299
1 changed files with 8 additions and 0 deletions
|
@ -711,10 +711,18 @@ class Runner(object):
|
||||||
actual_transport = inject.get('ansible_connection', self.transport)
|
actual_transport = inject.get('ansible_connection', self.transport)
|
||||||
actual_private_key_file = inject.get('ansible_ssh_private_key_file', self.private_key_file)
|
actual_private_key_file = inject.get('ansible_ssh_private_key_file', self.private_key_file)
|
||||||
actual_private_key_file = template.template(self.basedir, actual_private_key_file, inject, fail_on_undefined=True)
|
actual_private_key_file = template.template(self.basedir, actual_private_key_file, inject, fail_on_undefined=True)
|
||||||
|
self.sudo = utils.boolean(inject.get('ansible_sudo', self.sudo))
|
||||||
|
self.sudo_user = inject.get('ansible_sudo_user', self.sudo_user)
|
||||||
self.sudo_pass = inject.get('ansible_sudo_pass', self.sudo_pass)
|
self.sudo_pass = inject.get('ansible_sudo_pass', self.sudo_pass)
|
||||||
self.su = inject.get('ansible_su', self.su)
|
self.su = inject.get('ansible_su', self.su)
|
||||||
self.su_pass = inject.get('ansible_su_pass', self.su_pass)
|
self.su_pass = inject.get('ansible_su_pass', self.su_pass)
|
||||||
|
|
||||||
|
# select default root user in case self.sudo requested
|
||||||
|
# but no user specified; happens e.g. in host vars when
|
||||||
|
# just ansible_sudo=True is specified
|
||||||
|
if self.sudo and self.sudo_user is None:
|
||||||
|
self.sudo_user = 'root'
|
||||||
|
|
||||||
if actual_private_key_file is not None:
|
if actual_private_key_file is not None:
|
||||||
actual_private_key_file = os.path.expanduser(actual_private_key_file)
|
actual_private_key_file = os.path.expanduser(actual_private_key_file)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue