mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge branch 'delegate_to_honor_ssh_private_key_file' of https://github.com/renard/ansible into renard-delegate_to_honor_ssh_private_key_file
This commit is contained in:
commit
be4e6d359f
1 changed files with 6 additions and 0 deletions
|
@ -346,6 +346,12 @@ class Runner(object):
|
|||
delegate['transport'] = this_info.get('ansible_connection', self.transport)
|
||||
delegate['sudo_pass'] = this_info.get('ansible_sudo_pass', self.sudo_pass)
|
||||
|
||||
# Last chance to get private_key_file from global variables.
|
||||
# this is usefull if delegated host is not defined in the inventory
|
||||
if delegate['private_key_file'] is None:
|
||||
delegate['private_key_file'] = remote_inject.get(
|
||||
'ansible_ssh_private_key_file', None)
|
||||
|
||||
if delegate['private_key_file'] is not None:
|
||||
delegate['private_key_file'] = os.path.expanduser(delegate['private_key_file'])
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue