mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 12:21:26 -07:00
Fixes #5109 synchronize module ssh port
Added a parameter for dest_port and also check ansible_ssh_port inventory variable.
This commit is contained in:
parent
c259993559
commit
d227614529
2 changed files with 20 additions and 1 deletions
|
@ -70,6 +70,12 @@ class ActionModule(object):
|
|||
src_host = '127.0.0.1'
|
||||
dest_host = inject.get('ansible_ssh_host', inject['inventory_hostname'])
|
||||
|
||||
dest_port = options.get('dest_port')
|
||||
inv_port = inject.get('ansible_ssh_port', inject['inventory_hostname'])
|
||||
if inv_port != dest_port and inv_port != inject['inventory_hostname']:
|
||||
options['dest_port'] = inv_port
|
||||
|
||||
|
||||
# edge case: explicit delegate and dest_host are the same
|
||||
if dest_host == inject['delegate_to']:
|
||||
dest_host = '127.0.0.1'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue