2 ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
3 ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
9 template = 'service @@TARGET_HOST@@@@TARGET_PORT@@
22 server_args = -o PreferredAuthentications=publickey -o EscapeChar=none -o BatchMode=yes -C @@SSH_OPTIONS@@ @@TARGET_HOST@@ forward-to @@TARGET_PORT@@
27 config = YAML.load(File.open('/etc/puppet/modules/portforwarder/misc/config.yaml').read)
29 config[@fqdn].each do |service|
30 target_port = service['target_port']
31 target_host = service['target_host']
32 local_bind = service['source_bind_port']
33 ssh_options = service['ssh_options'] || ""
35 lines << "# to #{target_port.to_s}:target_host from local port #{local_bind.to_s}"
36 if target_port.nil? or target_host.nil? or local_bind.nil?
37 lines << "# insufficient config values"
40 p.gsub!('@@TARGET_HOST@@', target_host)
41 p.gsub!('@@TARGET_PORT@@', target_port.to_s)
42 p.gsub!('@@LOCAL_BIND@@', local_bind.to_s)
43 p.gsub!('@@SSH_OPTIONS@@', ssh_options.to_s)