diff options
author | ytti <saku@ytti.fi> | 2017-07-02 14:15:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-02 14:15:42 +0300 |
commit | b7f823617c9babb416d797334a2d6951d6a9f223 (patch) | |
tree | 9f4ab53a8d71307787fa0c6a06f5cf38f38df519 | |
parent | 7e87b3c7ee2d7c3002e732cc774617892374d861 (diff) | |
parent | 8ea89e7fdc2e43b050630080535b08cb878fc2a5 (diff) |
Merge pull request #909 from Fauli83/new_ssh
Use newer net-ssh as default requirement
-rw-r--r-- | lib/oxidized/input/ssh.rb | 19 | ||||
-rw-r--r-- | oxidized.gemspec | 2 |
2 files changed, 12 insertions, 9 deletions
diff --git a/lib/oxidized/input/ssh.rb b/lib/oxidized/input/ssh.rb index 858d5cd..27e81e0 100644 --- a/lib/oxidized/input/ssh.rb +++ b/lib/oxidized/input/ssh.rb @@ -24,20 +24,23 @@ module Oxidized secure = Oxidized.config.input.ssh.secure @log = File.open(Oxidized::Config::Log + "/#{@node.ip}-ssh", 'w') if Oxidized.config.input.debug? port = vars(:ssh_port) || 22 + + ssh_opts = { + :port => port.to_i, + :password => @node.auth[:password], :timeout => Oxidized.config.timeout, + :paranoid => secure, + :auth_methods => %w(none publickey password keyboard-interactive), + :number_of_password_prompts => 0, + } + if proxy_host = vars(:ssh_proxy) proxy_command = "ssh " proxy_command += "-o StrictHostKeyChecking=no " unless secure proxy_command += "#{proxy_host} -W %h:%p" proxy = Net::SSH::Proxy::Command.new(proxy_command) + ssh_opts[:proxy] = proxy end - ssh_opts = { - :port => port.to_i, - :password => @node.auth[:password], :timeout => Oxidized.config.timeout, - :paranoid => secure, - :auth_methods => %w(none publickey password keyboard-interactive), - :number_of_password_prompts => 0, - :proxy => proxy, - } + ssh_opts[:keys] = vars(:ssh_keys).is_a?(Array) ? vars(:ssh_keys) : [vars(:ssh_keys)] if vars(:ssh_keys) ssh_opts[:kex] = vars(:ssh_kex).split(/,\s*/) if vars(:ssh_kex) ssh_opts[:encryption] = vars(:ssh_encryption).split(/,\s*/) if vars(:ssh_encryption) diff --git a/oxidized.gemspec b/oxidized.gemspec index ea088e7..a8e3eb5 100644 --- a/oxidized.gemspec +++ b/oxidized.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| s.required_ruby_version = '>= 2.0.0' s.add_runtime_dependency 'asetus', '~> 0.1' s.add_runtime_dependency 'slop', '~> 3.5' - s.add_runtime_dependency 'net-ssh', '~> 3.0.2' + s.add_runtime_dependency 'net-ssh', '~> 4.1.0' s.add_runtime_dependency 'rugged', '~> 0.21', '>= 0.21.4' if defined?(RUBY_VERSION) && RUBY_VERSION > '2.3' |