summaryrefslogtreecommitdiff
path: root/lib/oxidized/model
diff options
context:
space:
mode:
authorMike Bryant <m@ocado.com>2016-02-02 11:03:11 +0000
committerMike Bryant <m@ocado.com>2016-02-02 11:03:11 +0000
commitba5bfd826ce8d13500497ff477ec219df921f527 (patch)
tree19807f9b5c33238693678c8bcf8df90ee9939208 /lib/oxidized/model
parenta70afa90707df43408caa1dd3989058ef6dfc910 (diff)
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