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:
James Tanner 2013-12-03 14:46:44 -05:00
parent c259993559
commit d227614529
2 changed files with 20 additions and 1 deletions

View file

@ -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'