summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2018-04-27 14:35:34 +0300
committerGitHub <noreply@github.com>2018-04-27 14:35:34 +0300
commiteedaeff5b159a3e2dc0f2020000d2b39ccfbed2f (patch)
tree655fe8f951b06aaa94a9c9b111a6f0cbcc475915
parent1311573a1adff6edf2c0b3cfdb05ca83d6c46e73 (diff)
parent90e1c91ae52ecbcc5b733f166e110faf9b698687 (diff)
Merge pull request #1175 from laf/ssh-auth-methods
Added support for setting ssh auth methods
-rw-r--r--docs/Configuration.md9
-rw-r--r--docs/Model-Notes/EOS.md9
-rw-r--r--docs/Model-Notes/README.md1
-rw-r--r--lib/oxidized/input/ssh.rb5
-rw-r--r--lib/oxidized/worker.rb6
-rw-r--r--spec/input/ssh_spec.rb2
6 files changed, 29 insertions, 3 deletions
diff --git a/docs/Configuration.md b/docs/Configuration.md
index 661e65a..1d16c91 100644
--- a/docs/Configuration.md
+++ b/docs/Configuration.md
@@ -62,6 +62,15 @@ vars:
ssh_no_exec: true
```
+## SSH Auth Methods
+
+By default, Oxidized registers the following auth methods: `none`, `publickey` and `password`. However you can configure this globally, by groups, models or nodes.
+
+```
+vars:
+ auth_methods: none, publickey, password, keyboard-interactive
+```
+
## SSH Proxy Command
Oxidized can `ssh` through a proxy as well. To do so we just need to set `ssh_proxy` variable with the proxy host information.
diff --git a/docs/Model-Notes/EOS.md b/docs/Model-Notes/EOS.md
new file mode 100644
index 0000000..66287e3
--- /dev/null
+++ b/docs/Model-Notes/EOS.md
@@ -0,0 +1,9 @@
+Arista EOS Configuration
+========================
+
+By default EOS requires keyboard-interactive to be added to your Oxidized config. You can avoid having to do this by configuring the following on the EOS device:
+
+```
+management ssh
+ authentication mode password
+```
diff --git a/docs/Model-Notes/README.md b/docs/Model-Notes/README.md
index fd1298e..890ac7d 100644
--- a/docs/Model-Notes/README.md
+++ b/docs/Model-Notes/README.md
@@ -10,6 +10,7 @@ Vendor | Model |Updated
3COM|[Comware](Comware.md)|15 Feb 2018
AireOS|[AireOS](AireOS.md)|29 Nov 2017
Arbor Networks|[ArbOS](ArbOS.md)|27 Feb 2018
+Arista|[EOS](EOS.md)|05 Feb 2018
Huawei|[VRP](VRP-Huawei.md)|17 Nov 2017
Juniper|[MX/QFX/EX/SRX/J Series](JunOS.md)|18 Jan 2018
Netgear|[Netgear](Netgear.md)|11 Apr 2018
diff --git a/lib/oxidized/input/ssh.rb b/lib/oxidized/input/ssh.rb
index dc1eb27..6e86d13 100644
--- a/lib/oxidized/input/ssh.rb
+++ b/lib/oxidized/input/ssh.rb
@@ -29,11 +29,14 @@ module Oxidized
port: port.to_i,
paranoid: secure,
keepalive: true,
- auth_methods: %w(none publickey password keyboard-interactive),
password: @node.auth[:password], :timeout => Oxidized.config.timeout,
number_of_password_prompts: 0,
}
+ auth_methods = vars(:auth_methods) || %w(none publickey password)
+ ssh_opts[:auth_methods] = auth_methods
+ Oxidized.logger.info "AUTH METHODS::#{auth_methods}"
+
if proxy_host = vars(:ssh_proxy)
proxy_command = "ssh "
proxy_command += "-o StrictHostKeyChecking=no " unless secure
diff --git a/lib/oxidized/worker.rb b/lib/oxidized/worker.rb
index 7eaa888..692b060 100644
--- a/lib/oxidized/worker.rb
+++ b/lib/oxidized/worker.rb
@@ -80,7 +80,11 @@ module Oxidized
private
def is_cycle_finished?
- @jobs_done > 0 && @jobs_done % @nodes.count == 0
+ if @jobs_done > @nodes.count
+ true
+ else
+ @jobs_done > 0 && @jobs_done % @nodes.count == 0
+ end
end
def run_done_hook
diff --git a/spec/input/ssh_spec.rb b/spec/input/ssh_spec.rb
index 9e08cea..3c33cd8 100644
--- a/spec/input/ssh_spec.rb
+++ b/spec/input/ssh_spec.rb
@@ -34,7 +34,7 @@ describe Oxidized::SSH do
proxy: proxy,
password: 'armud',
number_of_password_prompts: 0,
- auth_methods: ['none', 'publickey', 'password', 'keyboard-interactive'])
+ auth_methods: %w[none publickey password])
ssh.instance_variable_set("@exec", true)
ssh.connect(@node)