-
Notifications
You must be signed in to change notification settings - Fork 5.6k
salt/utils/cloud: Allow to customize ssh gateway command/options #48062
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
salt/utils/cloud: Allow to customize ssh gateway command/options #48062
Conversation
By default, nc command (nc -q0 %h %p) is used to create gateway. This is not always possible in some restricted environments. An alternative is to use native support from ssh: -W %h:%p. This commit allows user to provide a customize option for gateway. Please note the (wait_for_port) process may need another patch.
gtmanfred
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be documented in salt/cloud/clouds/ec2.py, as well as adding the gateway stuff to ./doc/topics/cloud/misc.rst
doc/man/salt.7
Outdated
| # Default to nc -q0 %h %p | ||
| # Optional | ||
| ssh_gateway_command: "-W %h:%p" | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this change, we compile these every time we build, so this will not remain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks a lot. I will update ec2.py and misc.rst instead :)
|
Thanks @gtmanfred and @cachedout for your reviews and approvals. |
|
Thanks @icy and congrats on your first salt PR. :) |
Minor improvements and fixes for related PR: #48062
|
Hi @rallytime and @gtmanfred, Is there any good start to write and improve unit tests (e.g., in my PRs)? At my laptop, the tests are passed as seen here https://gist.github.com/icy/a59f975ba54224b7d941b2e38ccc74a1 , I don't think these tests are working fine. I did some smoke tests actually and it's not a recommended way (expensive?) |
Some variables are not in their right scope; that makes salt crashed when user settings do not include some gateway settings. Cf: saltstack#48062
Some variables are not in their right scope; that makes salt crashed when user settings do not include some gateway settings. Cf: saltstack#48062
What does this PR do?
By default, nc command (
nc -q0 %h %p) is used to create gateway. This is notalways possible in some restricted environments. An alternative is to use
native support from ssh:
-W %h:%p.This commit allows user to provide a customize option for gateway. Please note
the (wait_for_port) process may need another patch.
What issues does this PR fix or reference?
Previous Behavior
Users are forced to use
nc -q0 %h %pcommand to create ssh proxy forsalt-cloudNew Behavior
Users can use a customized command to create ssh proxy for
salt-cloudTests written?
NO
Commits signed with GPG?
Yes