Open eedgar opened 7 years ago
Workaround
diff --git a/st2common/st2common/runners/paramiko_ssh.py b/st2common/st2common/runners/paramiko_ssh.py
index 599d0af..6038619 100644
--- a/st2common/st2common/runners/paramiko_ssh.py
+++ b/st2common/st2common/runners/paramiko_ssh.py
@@ -125,6 +125,13 @@ class ParamikoSSHClient(object):
False otherwise.
:rtype: ``bool``
"""
+ ssh_config_file_info = {}
+ if cfg.CONF.ssh_runner.use_ssh_config:
+ ssh_config_file_info = self._get_ssh_config_for_host(self.hostname)
+
+ if 'bastion_host' in ssh_config_file_info:
+ self.bastion_host = ssh_config_file_info['bastion_host']
+
if self.bastion_host:
self.logger.debug('Bastion host specified, connecting')
self.bastion_client = self._connect(host=self.bastion_host)
@@ -661,7 +668,13 @@ class ParamikoSSHClient(object):
ssh_config_info['identityfile'] = key_file
if 'proxycommand' in ssh_config:
- ssh_config_info['sock'] = paramiko.ProxyCommand(ssh_config['proxycommand'])
+ # This is an ugly hack as paramiko.ProxyCommand isnt working :/
+ # Assumes proxy command of ssh -W %h %p bastion
+ proxy_command_split = ssh_config['proxycommand'].split()
+ if proxy_command_split[0] == 'ssh':
+ ssh_config_info['bastion_host'] = ssh_config_parser.lookup(proxy_command_split[-1])['hostname']
+
+ #ssh_config_info['sock'] = paramiko.ProxyCommand(ssh_config['proxycommand'])
return ssh_config_info
Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically marking is as stale. If this issue is not relevant or applicable anymore (problem has been fixed in a new version or similar), please close the issue or let us know so we can close it. On the contrary, if the issue is still relevant, there is nothing you need to do, but if you have any additional details or context which would help us when working on this issue, please include it as a comment to this issue.
config contains
we are just trying to setup a ssh jumphost and reuse the ssh_config for that.