4 template = 'service @@TARGET_HOST@@@@TARGET_PORT@@
17 server_args = -o PreferredAuthentications=publickey -o EscapeChar=none -C @@TARGET_HOST@@ forward-to @@TARGET_PORT@@
22 config = YAML.load(File.open('/etc/puppet/modules/portforwarder/misc/config.yaml').read)
24 config[fqdn].each do |service|
25 target_port = service['target_port']
26 target_host = service['target_host']
27 local_bind = service['source_bind_port']
29 lines << "# to #{target_port.to_s}:target_host from local port #{local_bind.to_s}"
30 if target_port.nil? or target_host.nil? or local_bind.nil?
31 lines << "# insufficient config values"
34 p.gsub!('@@TARGET_HOST@@', target_host)
35 p.gsub!('@@TARGET_PORT@@', target_port.to_s)
36 p.gsub!('@@LOCAL_BIND@@', local_bind.to_s)