diff options
author | Nat Lasseter <user@4574.co.uk> | 2017-01-19 10:54:32 +0000 |
---|---|---|
committer | Nat Lasseter <user@4574.co.uk> | 2017-01-19 10:54:32 +0000 |
commit | 07a17b442d7d7a397d076babfaa29fd2620921d7 (patch) | |
tree | 03d9095590bfe16b15d11b944b527c6d43b49e41 /example.rb |
Initial commit
Diffstat (limited to 'example.rb')
-rwxr-xr-x | example.rb | 36 |
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: |