Skip to content

Commit babcce1

Browse files
committed
Merge remote-tracking branch 'origin/master' into edge
2 parents b8767d7 + b31e7bb commit babcce1

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

mig/shared/cloud.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,9 +1025,9 @@ def _get_encoder(configuration, coding):
10251025

10261026

10271027
def _get_jump_host(configuration, client_id, cloud_id, manage=False):
1028-
"""Return any configured ssh jump host ssh details including address, port
1029-
and username for client_id on cloud_id. If the optional manage arg is set
1030-
the two additional manage key script and coding settings are added.
1028+
"""Return any configured ssh jump host ssh details including address, port,
1029+
username and key for client_id on cloud_id. If the optional manage arg is
1030+
set the two additional manage key script and coding settings are added.
10311031
"""
10321032
_logger = configuration.logger
10331033
jump_host = {}
@@ -1041,6 +1041,8 @@ def _get_jump_host(configuration, client_id, cloud_id, manage=False):
10411041
jump_host['fqdn'] = cloud_fqdn_from_ip(configuration, addr)[0]
10421042
jump_host['user'] = lookup_user_service_value(
10431043
configuration, client_id, service, 'service_jumphost_user', '')
1044+
jump_host['key'] = lookup_user_service_value(
1045+
configuration, client_id, service, 'service_jumphost_key', '')
10441046
# TODO: support jumphost port with port map override?
10451047
if manage:
10461048
for name in ('manage_keys_script', 'manage_keys_coding'):
@@ -1094,6 +1096,8 @@ def _manage_jump_host_keys(configuration, client_id, cloud_id, action,
10941096
ssh_cmd = ['ssh']
10951097
if jump_host['user']:
10961098
ssh_cmd.append('-oUser=%(user)s' % jump_host)
1099+
if jump_host['key']:
1100+
ssh_cmd.append('-oIdentityFile=%(key)s' % jump_host)
10971101
ssh_cmd.append("%(fqdn)s" % jump_host)
10981102
# NOTE: remote script should restrict key access to reduce abuse risk with
10991103
# command="/bin/false",no-pty,no-agent-forwarding,no-X11-forwarding PUBKEY

mig/shared/configuration.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1593,7 +1593,8 @@ def reload_config(self, verbose, skip_log=False, disable_auth_log=False):
15931593
'service_floating_network_id',
15941594
'service_availability_zone',
15951595
'service_jumphost_address',
1596-
'service_jumphost_user']
1596+
'service_jumphost_user',
1597+
'service_jumphost_key']
15971598
# Load generated cloud sections
15981599
for section in config.sections():
15991600
if 'CLOUD_' in section:

0 commit comments

Comments
 (0)