aboutsummaryrefslogtreecommitdiff
path: root/example.rb
diff options
context:
space:
mode:
Diffstat (limited to 'example.rb')
-rwxr-xr-xexample.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/example.rb b/example.rb
new file mode 100755
index 0000000..ef72483
--- /dev/null
+++ b/example.rb
@@ -0,0 +1,36 @@
+# This is ruby
+# Lets make a method for later
+def old_keys
+ kexalgorithms "+diffie-hellman-group1-sha1"
+ hostkeyalgorithms "+ssh-dss"
+end
+
+hosts {
+ # Simple things
+ host("example") {
+ hostname "example.com"
+ }
+ host("pi") {
+ hostname "192.168.3.14"
+ user "root"
+ }
+
+ # LOOPS!
+ # #contrived
+ # Also, that method from earlier
+ (1..70).each { |machine|
+ host("my#{machine}-1") { hostname "mymachine#{machine}-1.example.co.uk" ; old_keys }
+ host("my#{machine}-2") { hostname "mymachine#{machine}-2.example.co.uk" ; old_keys }
+ }
+
+ # NO
+ # Don't do this
+ # Just remember that every directive is a method
+ host ('*') {
+ strictHostKeyChecking NO
+ userKnownHostsFile "/dev/null"
+ logLevel "ERROR"
+ }
+}
+
+# vim: set ft=ruby: