summaryrefslogtreecommitdiff
path: root/lib/oxidized/model
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2016-02-02 13:51:23 +0200
committerytti <saku@ytti.fi>2016-02-02 13:51:23 +0200
commitfd8922e812ba979f9ccb542dcc1ada4e740b9431 (patch)
treebb4650d13bda02e1fd1c2ba995ab3e59a32c0709 /lib/oxidized/model
parent8b15d01422a32eda7505d67b4387a15ed192d251 (diff)
parentba5bfd826ce8d13500497ff477ec219df921f527 (diff)
Merge pull request #302 from ocadotechnology/add-opengear
Add OpenGear model
Diffstat (limited to 'lib/oxidized/model')
-rw-r--r--lib/oxidized/model/opengear.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/oxidized/model/opengear.rb b/lib/oxidized/model/opengear.rb
new file mode 100644
index 0000000..7f801f8
--- /dev/null
+++ b/lib/oxidized/model/opengear.rb
@@ -0,0 +1,19 @@
+class OpenGear < Oxidized::Model
+
+ comment '# '
+
+ cmd :secret do |cfg|
+ cfg.gsub!(/password (\S+)/, 'password <secret removed>')
+ cfg.gsub!(/community (\S+)/, 'community <secret removed>')
+ cfg
+ end
+
+ cmd('cat /etc/version') { |cfg| comment cfg }
+
+ cmd 'config -g config'
+
+ cfg :ssh do
+ exec true # don't run shell, run each command in exec channel
+ end
+
+end