lib/rcmd.rb in rcmd-1.6.6 vs lib/rcmd.rb in rcmd-1.6.7
- old
+ new
@@ -46,10 +46,13 @@
# Boolean for using only ssh-keys or not
attr_accessor :keys_only
# String fo path to user_known_hosts_file
attr_accessor :hosts_file
+
+ # Array of key_file(s) to use
+ attr_accessor :key_file
end
# Main method for this module which should be called after the correct variables have been set.
#
# We iterate over the host list until it is empty, creating all
@@ -99,10 +102,10 @@
# Prepare threads
@threads = [ ]
num_threads.times do |i|
@threads[i] = Thread.new {
begin
- conn_options = { :user => @user, :host => @queue.pop, :password => nil, :quiet => @quiet, :debug => @debug, :keys_only => @keys_only, :user_known_hosts_file => @hosts_file}
+ conn_options = { :user => @user, :host => @queue.pop, :password => nil, :quiet => @quiet, :debug => @debug, :keys_only => @keys_only, :user_known_hosts_file => @hosts_file, :keys => @key_file}
STDERR.print "DEBUG :: Connecting to #{conn_options[:host]}\n" if conn_options[:debug]
Net::SSH.start(conn_options[:host], conn_options[:user], :password => conn_options[:passwd]) do |session|
# Open channel for input/output control
session.open_channel do |channel|
channel.on_data do |ch, data|