lib/rundock/backend.rb in rundock-0.2.2 vs lib/rundock/backend.rb in rundock-0.2.3
- old
+ new
@@ -1,10 +1,11 @@
require 'rundock'
require 'singleton'
require 'specinfra/core'
require 'io/console'
require 'net/ssh'
+require 'net/ssh/proxy/command'
Specinfra::Configuration.error_on_missing_backend_type = true
module Rundock
module Backend
@@ -62,10 +63,14 @@
end
def create_specinfra_backend
raise NotImplementedError
end
+
+ def method_missing(method, *args)
+ @backend.send(method, *args)
+ end
end
class Local < Base
private
@@ -86,13 +91,15 @@
ssh_opts = Net::SSH::Config.for(options[:host], [options[:ssh_config]])
else
ssh_opts = Net::SSH::Config.for(options[:host])
end
+ # priority = node_attributes > cli options
ssh_opts[:host_name] = options[:host]
ssh_opts[:keys] = Array(options[:key]) if options[:key]
ssh_opts[:password] = parse_password_from_stdin if options[:ask_password]
ssh_opts.merge!(filter_net_ssh_options(options))
+ ssh_opts[:proxy] = Kernel.eval(options[:proxy]) if options[:proxy]
Logger.debug(%(Net::SSH Options: "#{ssh_opts}"))
ssh_opts
end