]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
Support ssh options for portforwarder
authorPeter Palfrader <peter@palfrader.org>
Fri, 10 Jun 2011 10:58:49 +0000 (12:58 +0200)
committerPeter Palfrader <peter@palfrader.org>
Fri, 10 Jun 2011 10:58:49 +0000 (12:58 +0200)
modules/portforwarder/misc/config.yaml
modules/portforwarder/templates/xinetd.erb

index ad9abaa8eebc51c309eef48d17bd48d9d521957c..7ce085d5fea5c4e330a90c2af66c757d7383af90 100644 (file)
@@ -46,6 +46,7 @@ stabile.debian.org:
   - source_bind_port: 15433
     target_host: sibelius.debian.org
     target_port: 5433
+    ssh_options: -oAddressFamily=inet
 
 franck.debian.org:
   - source_bind_port: 5443
index c2209355f2d4751cd9af11e8e1cd4d6dfc2d9506..7ff0dfb0d39df2a56bc62d6be8721e8bd12ae4b7 100644 (file)
@@ -19,7 +19,7 @@ template = 'service @@TARGET_HOST@@@@TARGET_PORT@@
         group           = portforwarder
         instances       = 10
         server          = /usr/bin/ssh
-        server_args     = -o PreferredAuthentications=publickey -o EscapeChar=none -o BatchMode=yes -C @@TARGET_HOST@@ forward-to @@TARGET_PORT@@
+        server_args     = -o PreferredAuthentications=publickey -o EscapeChar=none -o BatchMode=yes -C @@SSH_OPTIONS@@ @@TARGET_HOST@@ forward-to @@TARGET_PORT@@
         cps             = 0 0
 }
 '
@@ -30,6 +30,7 @@ if config[fqdn]
                target_port = service['target_port']
                target_host = service['target_host']
                local_bind = service['source_bind_port']
+               ssh_options = service['ssh_options'] || ""
 
                lines << "# to #{target_port.to_s}:target_host from local port #{local_bind.to_s}"
                if target_port.nil? or target_host.nil? or local_bind.nil?
@@ -39,6 +40,7 @@ if config[fqdn]
                        p.gsub!('@@TARGET_HOST@@', target_host)
                        p.gsub!('@@TARGET_PORT@@', target_port.to_s)
                        p.gsub!('@@LOCAL_BIND@@', local_bind.to_s)
+                       p.gsub!('@@SSH_OPTIONS@@', ssh_options.to_s)
                        lines << p
                end
        end