mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-27 18:50:21 -07:00
Merge pull request #6213 from sergevanginderachter/fix-delegate-templating
Fixes templating of ansible_ssh_host for delegates. Tested that this works. Confirmed.
This commit is contained in:
commit
e79d859dfb
1 changed files with 5 additions and 2 deletions
|
@ -303,7 +303,7 @@ class Runner(object):
|
||||||
|
|
||||||
delegate = {}
|
delegate = {}
|
||||||
|
|
||||||
# allow ansible_ssh_host to be templated
|
# allow delegated host to be templated
|
||||||
delegate['host'] = template.template(self.basedir, host,
|
delegate['host'] = template.template(self.basedir, host,
|
||||||
remote_inject, fail_on_undefined=True)
|
remote_inject, fail_on_undefined=True)
|
||||||
|
|
||||||
|
@ -328,7 +328,10 @@ class Runner(object):
|
||||||
this_info = {}
|
this_info = {}
|
||||||
|
|
||||||
# get the real ssh_address for the delegate
|
# get the real ssh_address for the delegate
|
||||||
delegate['ssh_host'] = this_info.get('ansible_ssh_host', delegate['host'])
|
# and allow ansible_ssh_host to be templated
|
||||||
|
delegate['ssh_host'] = template.template(self.basedir,
|
||||||
|
this_info.get('ansible_ssh_host', this_host),
|
||||||
|
this_info, fail_on_undefined=True)
|
||||||
|
|
||||||
delegate['port'] = this_info.get('ansible_ssh_port', port)
|
delegate['port'] = this_info.get('ansible_ssh_port', port)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue