aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2012-03-22 18:07:23 +0000
committerMichael Scherer <misc@mageia.org>2012-03-22 18:07:23 +0000
commit61437a70323d4023a5eecac80be5060b6afa464b (patch)
treed5a2a38ccf32748c4b8edcc27301b62a25406050 /modules
parent108ec40613f5d91a7fa00e2dc9a84e2afdf3d4c1 (diff)
downloadpuppet-61437a70323d4023a5eecac80be5060b6afa464b.tar
puppet-61437a70323d4023a5eecac80be5060b6afa464b.tar.gz
puppet-61437a70323d4023a5eecac80be5060b6afa464b.tar.bz2
puppet-61437a70323d4023a5eecac80be5060b6afa464b.tar.xz
puppet-61437a70323d4023a5eecac80be5060b6afa464b.zip
add a define for portforwarding with xinetd
Diffstat (limited to 'modules')
-rw-r--r--modules/xinetd/manifests/port_forward.pp8
-rw-r--r--modules/xinetd/templates/port_forward16
2 files changed, 24 insertions, 0 deletions
diff --git a/modules/xinetd/manifests/port_forward.pp b/modules/xinetd/manifests/port_forward.pp
new file mode 100644
index 00000000..23d00f03
--- /dev/null
+++ b/modules/xinetd/manifests/port_forward.pp
@@ -0,0 +1,8 @@
+define xinetd::port_forward($target_ip, $target_port, $port, $proto = 'tcp') {
+ include xinetd
+ file { "/etc/xinetd.d/$name":
+ require => Package['xinetd'],
+ content => template('xinetd/port_forward'),
+ notify => Service['xinetd']
+ }
+}
diff --git a/modules/xinetd/templates/port_forward b/modules/xinetd/templates/port_forward
new file mode 100644
index 00000000..9ebdbb91
--- /dev/null
+++ b/modules/xinetd/templates/port_forward
@@ -0,0 +1,16 @@
+service <%= name %>
+{
+ disable = no
+ type = UNLISTED
+<%- if protocol == 'tcp' -%>
+ socket_type = stream
+<%- else -%>
+ socket_type = dgram
+<%- end -%>
+ protocol = <%= protocol %>
+ user = nobody
+ wait = no
+ redirect = <%= target_ip %> <%= target_port %>
+ port = <%= port %>
+}
+