]> gitweb.fluxo.info Git - puppet-tftp.git/commitdiff
Removing dependancy on 'inetd' which doesn't exist in the forge...
authorcrayfishx <craig@craigdunn.org>
Tue, 10 Jul 2012 21:27:10 +0000 (14:27 -0700)
committercrayfishx <craig@craigdunn.org>
Tue, 10 Jul 2012 21:27:10 +0000 (14:27 -0700)
Replaced with xinetd::service to set up the xinetd configuration

manifests/init.pp

index 5057eb278d7cf047522e3af755285b9a9331180e..df9dbc22f32a9ee734bb8458682aa4ff65e6fb5b 100644 (file)
@@ -58,25 +58,21 @@ class tftp (
       fail('tftp class does not support custom options when inetd is enabled.')
     }
 
-    include 'inetd'
-
-    augeas { 'inetd_tftp':
-      changes => [
-        "ins tftp after /files${inetd_conf}",
-        "set /files${inetd_conf}/tftp/socket dgram",
-        "set /files${inetd_conf}/tftp/protocol udp",
-        "set /files${inetd_conf}/tftp/wait wait",
-        "set /files${inetd_conf}/tftp/user ${username}",
-        "set /files${inetd_conf}/tftp/command /usr/libexec/tftpd",
-        "set /files${inetd_conf}/tftp/arguments/1 tftpd",
-        "set /files${inetd_conf}/tftp/arguments/2 --address",
-        "set /files${inetd_conf}/tftp/arguments/3 ${address}:${port}",
-        "set /files${inetd_conf}/tftp/arguments/4 --secure",
-        "set /files${inetd_conf}/tftp/arguments/5 ${directory}",
-      ],
-      require => Class['inetd'],
-    }
+    include 'xinetd'
 
+    xinetd::service { 'tftp':
+      port        => $port,
+      protocol    => 'udp',
+      server_args => "${options} ${directory}",
+      server      => $binary,
+      user        => $username,
+      bind        => $address,
+      socket_type => 'dgram',
+      cps         => '100 2',
+      flags       => 'IPv4',
+      per_source  => '11',
+      wait        => 'yes',
+  }
     $svc_ensure = stopped
     $svc_enable = false
   } else {
@@ -84,9 +80,9 @@ class tftp (
     $svc_enable = true
   }
 
-  $start = $binary ? {
-    undef =>  undef,
-    default =>  "${binary} -l -a ${address}:${port} -u ${username} ${options} ${directory}"
+  $start = $provider ? {
+    'base'  => "${binary} -l -a ${address}:${port} -u ${username} ${options} ${directory}",
+    default => undef
   }
 
   service { 'tftpd-hpa':