mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Saltify supports non-default ssh ports
This commit is contained in:
parent
aa8cee3ce3
commit
a0f3175904
@ -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_:
|
||||
|
@ -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)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user