<%=
+lines = []
config = YAML.load(File.open('/etc/puppet/modules/portforwarder/misc/config.yaml').read)
config.each_pair do |sourcehost, services|
+ ##lines << "# sourcehost is #{sourcehost}"
services.each do |service|
- next if service['target_host'] != hostname
+ ##lines << "# targethost is #{service['target_host']}, my hostname #{hostname}, fqdn is #{fqdn}"
+ next if service['target_host'] != fqdn
sshkey = nil
remote_ip = keyinfo[sourcehost][0]['ipHostNumber'].join(',')
forward_to_port = service['target_port']
- local_bind = 127.0.0.2
+ local_bind = '127.0.0.2'
lines << "# from #{sourcehost} on local port #{service['source_bind_port']}"
if remote_ip.nil? or forward_to_port.nil? or local_bind.nil?
end
end
end
-lines = []
lines.join("\n")
%>