Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly use port specified in the SSH config file in the remote SSH runner #4661

Merged
merged 10 commits into from
May 6, 2019

Conversation

Kami
Copy link
Member

@Kami Kami commented May 5, 2019

This pull request updates / fixes remote command and script runner to correctly use SSH port specified in the SSH config file if a non-default port is specified in the SSH config file and if SSH config file functionality is enabled (ssh_runner.use_ssh_config st2.conf config option is set to True).

NOTE: Due to the way of how we specify and handle default parameter values in the runner metadata file, this change is not 100% ideal, but it should cover most scenarios (Current code make it impossible to distinguish if a default parameter value is used or if user specified a value which matches a default value. Changing this would be more involved and also involves other parameters).

Resolves #4660.

Kami added 2 commits May 5, 2019 12:01
one is provided in the SSH config and it doesn't match a default port.

Part of #4660.
@Kami Kami added this to the 3.0.1 milestone May 5, 2019
Kami added 5 commits May 5, 2019 12:14
We now only support Paramiko based remote runner. Fabric one has been
removed and deprecated a long time ago.
port for indiviual entries) and don't default port to 22 in the runner
metadata to avoid issues with default values.
@Kami
Copy link
Member Author

Kami commented May 6, 2019

I made a change so we don't include a default value for the port parameter in runner.yaml file anymore.

This is the same approach we use for other default values which can also be read from the config (username, port, etc.) and it's more robust since it means it covers and works correctly in all the scenarios.

@@ -6,8 +6,7 @@
runner_parameters:
bastion_host:
description: 'The host SSH connections will be proxied through. Note: This connection
is made using the same parameters as the final connection, and is only used
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description was old and out of date since we don't use fabric runner for a long time anymore.

@Kami Kami requested a review from jinpingh May 6, 2019 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Paramiko SSH runner does not override ssh port from ssh config
2 participants