mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Added ssh_options variable to configure the SSH connection parameters (closes #2734)
git-svn-id: http://svn.rubyonrails.org/rails/tools/switchtower@2957 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
b09ca75550
commit
0e6ca2082e
4 changed files with 16 additions and 7 deletions
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* Added ssh_options variable to configure the SSH connection parameters #2734 [jerrett@bravenet.com]
|
||||
|
||||
* Require Net::SSH 1.0.3
|
||||
|
||||
|
||||
|
|
|
@ -43,7 +43,9 @@ module SwitchTower
|
|||
set :gateway, nil
|
||||
set :user, nil
|
||||
set :password, nil
|
||||
|
||||
|
||||
set :ssh_options, Hash.new
|
||||
|
||||
set :deploy_to, Proc.new { "/u/apps/#{application}" }
|
||||
|
||||
set :version_dir, DEFAULT_VERSION_DIR_NAME
|
||||
|
|
|
@ -38,6 +38,12 @@ role :db, "db02.example.com", "db03.example.com"
|
|||
# set :cvs, "/path/to/cvs" # defaults to searching the PATH
|
||||
# set :gateway, "gate.host.com" # default to no gateway
|
||||
|
||||
# =============================================================================
|
||||
# SSH OPTIONS
|
||||
# =============================================================================
|
||||
# ssh_options[:keys] = %w(/path/to/my/key /path/to/another/key)
|
||||
# ssh_options[:port] = 25
|
||||
|
||||
# =============================================================================
|
||||
# TASKS
|
||||
# =============================================================================
|
||||
|
|
|
@ -14,12 +14,11 @@ module SwitchTower
|
|||
password_value = nil
|
||||
|
||||
begin
|
||||
Net::SSH.start(server,
|
||||
:username => config.user,
|
||||
:password => password_value,
|
||||
:port => port,
|
||||
:auth_methods => methods.shift,
|
||||
&block)
|
||||
ssh_options = { :username => config.user,
|
||||
:password => password_value,
|
||||
:port => port,
|
||||
:auth_methods => methods.shift }.merge(config.ssh_options)
|
||||
Net::SSH.start(server,ssh_options,&block)
|
||||
rescue Net::SSH::AuthenticationFailed
|
||||
raise if methods.empty?
|
||||
password_value = config.password
|
||||
|
|
Loading…
Add table
Reference in a new issue