Saltify supports non-default ssh ports

This commit is contained in:
Steve Valaitis 2014-04-30 14:54:13 -05:00
parent aa8cee3ce3
commit a0f3175904
2 changed files with 10 additions and 0 deletions

View File

@ -133,6 +133,9 @@ def create(vm_):
'display_ssh_output', vm_, __opts__, default=True
)
}
if 'ssh_port' in vm_:
deploy_kwargs.update({'port': vm_['ssh_port']})
# forward any info about possible ssh gateway to deploy script
# as some providers need also a 'gateway' configuration
if 'gateway' in vm_:

View File

@ -1387,6 +1387,9 @@ def scp_file(dest_path, contents, kwargs):
'-i {0}'.format(kwargs['key_filename'])
])
if 'port' in kwargs:
ssh_args.extend(['-P {0}'.format(kwargs['port'])])
if 'ssh_gateway' in kwargs:
ssh_gateway = kwargs['ssh_gateway']
ssh_gateway_port = 22
@ -1562,6 +1565,10 @@ def root_cmd(command, tty, sudo, **kwargs):
ssh_gateway_user, ssh_gateway, ssh_gateway_port
)
)
if 'port' in kwargs:
ssh_args.extend(['-p {0}'.format(kwargs['port'])])
cmd = 'ssh {0} {1[username]}@{1[hostname]} {2}'.format(
' '.join(ssh_args), kwargs, pipes.quote(command)
)