exim: allow a host to indicate that it is the master for tracker.d.o
[mirror/dsa-puppet.git] / modules / xinetd / manifests / service.pp
index 3dbc8cb..62349ea 100644 (file)
@@ -1,13 +1,16 @@
 define xinetd::service (
-       $bind,
        $id,
        $server,
-       $port,
+       $service,
+       $port='',
+       $bind='',
+       $type='',
        $socket_type=stream,
        $protocol=tcp,
-       $flags=IPv6,
+       $flags='',
        $wait=no,
        $user=root,
+       $group='',
        $server_args='',
        $nice=10,
        $instances=100,
@@ -18,23 +21,22 @@ define xinetd::service (
 ) {
        include xinetd
 
-       case $ensure {
-               present,absent,file: {}
-               default: { fail("Invalid ensure for '$name'") }
+       file { "/etc/xinetd.d/${name}":
+               ensure  => $ensure,
+               content => template('xinetd/service.erb'),
+               notify  => Service['xinetd'],
+               require => Package['xinetd'],
        }
 
        if $ferm {
-               @ferm::rule { "dsa-xinetd-${name}":
-                       description => "Allow traffic to ${port}",
-                       rule        => "&SERVICE(${protocol}, ${port})"
+               $fermport = $port ? {
+                       "" => $service,
+                       default => $port
                }
-       }
 
-       file { "/etc/xinetd.d/${name}.conf":
-               ensure  => $ensure,
-               noop    => true,
-               content => template('xinetd/service.erb'),
-               notify  => Service['xinetd'],
-               require => Package['xinetd'],
+               ferm::rule { "dsa-xinetd-${name}":
+                       description => "Allow traffic to ${service}",
+                       rule        => "&SERVICE(${protocol}, ${fermport})"
+               }
        }
 }