mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
Use default port if ansible_ssh_port is not set for the delegated node
Also add testcase for it.
This commit is contained in:
parent
be300b562a
commit
fbda2d4628
4 changed files with 23 additions and 5 deletions
|
@ -384,6 +384,7 @@ class Runner(object):
|
|||
interpreters.append(i)
|
||||
for i in interpreters:
|
||||
del inject[i]
|
||||
port = C.DEFAULT_REMOTE_PORT
|
||||
try:
|
||||
delegate_info = inject['hostvars'][delegate_to]
|
||||
actual_host = delegate_info.get('ansible_ssh_host', delegate_to)
|
||||
|
@ -393,6 +394,7 @@ class Runner(object):
|
|||
inject[i] = delegate_info[i]
|
||||
except errors.AnsibleError:
|
||||
actual_host = delegate_to
|
||||
actual_port = port
|
||||
|
||||
try:
|
||||
if actual_port is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue