diff options
author | elijah <elijah@riseup.net> | 2013-06-11 09:41:26 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2013-06-11 09:41:26 -0700 |
commit | 404353dcf345122c0f04555a572efc5417f1b661 (patch) | |
tree | 322ed07b40d02da27d41a00bc46d09dbd9259011 /lib/leap_cli/util | |
parent | 34a8237d7172c19547b74bd972bfe908c272c4ab (diff) |
added --ip and --port override flags to deploy and init.
Diffstat (limited to 'lib/leap_cli/util')
-rw-r--r-- | lib/leap_cli/util/remote_command.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/leap_cli/util/remote_command.rb b/lib/leap_cli/util/remote_command.rb index db02037..2c77196 100644 --- a/lib/leap_cli/util/remote_command.rb +++ b/lib/leap_cli/util/remote_command.rb @@ -9,6 +9,7 @@ module LeapCli; module Util; module RemoteCommand # Capistrano::Logger::TRACE = 3 # def ssh_connect(nodes, options={}, &block) + options ||= {} node_list = parse_node_list(nodes) cap = new_capistrano @@ -30,7 +31,7 @@ module LeapCli; module Util; module RemoteCommand end node_list.each do |name, node| - cap.server node.name, :dummy_arg, node_options(node) + cap.server node.name, :dummy_arg, node_options(node, options[:ssh_options]) end yield cap @@ -58,13 +59,14 @@ module LeapCli; module Util; module RemoteCommand # password_proc = Proc.new {Capistrano::CLI.password_prompt "Root SSH password for #{node.name}"} # return {:password => password_proc} # - def node_options(node) + def node_options(node, ssh_options_override=nil) + ssh_options_override ||= {} { :ssh_options => { :host_key_alias => node.name, :host_name => node.ip_address, :port => node.ssh.port - }.merge(contingent_ssh_options_for_node(node)) + }.merge(contingent_ssh_options_for_node(node)).merge(ssh_options_override) } end |