]> gitweb.fluxo.info Git - puppet-tftp.git/commitdiff
Make xinetd the default method for installing tftp
authorcrayfishx <craig@craigdunn.org>
Mon, 16 Jul 2012 18:54:20 +0000 (11:54 -0700)
committercrayfishx <craig@craigdunn.org>
Mon, 16 Jul 2012 18:54:20 +0000 (11:54 -0700)
* Switched the inetd parameter to default to true
* Moved the value into params.pp
* Updated tests
* Updated README

README.md
manifests/init.pp
manifests/params.pp
spec/classes/tftp_spec.rb

index 996f88968854c0876d9500b80fc0ac26b4248872..ae9917687c011edda5699ea2ddd84493e3faa517 100644 (file)
--- a/README.md
+++ b/README.md
@@ -4,6 +4,8 @@
 
 Install tftp-hpa package and configuration files
 
+This module will install TFTP as a xinetd service by default. It can be overridden to run as a standalone daemon by setting the inetd parameter to false.
+
 ## Usage
 
 ### class tftp
@@ -15,7 +17,7 @@ Parameters:
 * address: bind address, default 0.0.0.0.
 * port: bind port, default 69.
 * options: service option, default --secure.
-* inetd: run service via xinetd - default false.
+* inetd: run service via xinetd - default true
 
 Example:
 
index 973049cc3f88c738fe1ff71574996a3c207af347..8becd7d8c61260b624090a390e25aad8284f398a 100644 (file)
@@ -29,7 +29,7 @@ class tftp (
   $address    = $tftp::params::address,
   $port       = $tftp::params::port,
   $options    = $tftp::params::options,
-  $inetd      = false,
+  $inetd      = $tftp::params::inetd,
   $package    = $tftp::params::package,
   $binary     = $tftp::params::binary,
   $defaults   = $tftp::params::defaults
index 35200687aec53b1f83d64f739ba8e22cf62eb80f..93344b7ddfc236115e9054d4380bb1d4614c1aaa 100644 (file)
@@ -6,6 +6,7 @@ class tftp::params {
   $port       = '69'
   $options    = '--secure'
   $binary     = '/usr/sbin/in.tftpd'
+  $inetd      = true
 
   case $::osfamily {
     'debian': {
index 21e6f727cc06a287dd111bdf9d29c0a03f49224e..872a82df2301fa376e7cc4a3a653917769b1dcfe 100644 (file)
@@ -1,11 +1,11 @@
 require 'spec_helper'
 describe 'tftp', :type => :class do
 
-  describe 'when deploying on debian' do
+  describe 'when deploying on debian as standalone' do
     let(:facts) { { :operatingsystem  => 'Debian',
                     :osfamily         => 'Debian',
                     :path             => '/usr/local/bin:/usr/bin:/bin', } }
-
+    let(:params) { {  :inetd  => false, } }
     it {
       should contain_file('/etc/default/tftpd-hpa')
       should contain_package('tftpd-hpa')
@@ -18,11 +18,11 @@ describe 'tftp', :type => :class do
     }
   end
 
-  describe 'when deploying on ubuntu' do
+  describe 'when deploying on ubuntu as standalone' do
     let(:facts) { { :operatingsystem  => 'Ubuntu',
                     :osfamily         => 'Debian',
                     :path             => '/usr/local/bin:/usr/bin:/bin', } }
-
+    let(:params) { {  :inetd  => false, } }
     it {
       should contain_package('tftpd-hpa')
       should contain_file('/etc/default/tftpd-hpa')
@@ -35,10 +35,10 @@ describe 'tftp', :type => :class do
     }
   end
 
-  describe 'when deploying on redhat family' do
+  describe 'when deploying on redhat family as standalone' do
     let (:facts) { {  :osfamily         => 'RedHat',
                       :path             => '/usr/local/bin:/usr/bin:/bin', } }
-
+    let(:params) { {  :inetd  => false, } }
     it {
       should contain_package('tftpd-hpa').with({
         'name'      => 'tftp-server',
@@ -54,11 +54,12 @@ describe 'tftp', :type => :class do
     }
   end
 
-  describe 'when deploying on redhat family with custom options' do
+  describe 'when deploying on redhat family with custom options as standalone' do
     let (:facts) { {  :osfamily         => 'RedHat',
                       :path             => '/usr/local/bin:/usr/bin:/bin', } }
     let (:params) { { :address          => '127.0.0.1',
                       :port             => '1069',
+                      :inetd            => false,
                       :username         => 'root',
                       :options          => '--secure --timeout 50',
                       :directory        => '/tftpboot', } }
@@ -81,7 +82,6 @@ describe 'tftp', :type => :class do
   describe 'when deploying with xinetd on redhat family' do
     let (:facts) { {  :osfamily => 'Redhat',
                       :path     => '/usr/local/bin:/usr/bin:/bin', } }
-    let (:params) { { :inetd    => true, } }
     it {
       should include_class('xinetd')
       should contain_service('tftpd-hpa').with({
@@ -107,7 +107,6 @@ describe 'tftp', :type => :class do
     let (:facts) { {  :osfamily         => 'Debian',
                       :operatingsystem  => 'Ubuntu',
                       :path     => '/usr/local/bin:/usr/bin:/bin', } }
-    let (:params) { { :inetd    => true, } }
     it {
       should include_class('xinetd')
       should contain_service('tftpd-hpa').with({
@@ -133,7 +132,6 @@ describe 'tftp', :type => :class do
     let (:facts) { {  :osfamily         => 'Debian',
                       :operatingsystem  => 'Debian',
                       :path     => '/usr/local/bin:/usr/bin:/bin', } }
-    let (:params) { { :inetd    => true, } }
     it {
       should include_class('xinetd')
       should contain_xinetd__service('tftp').with({
@@ -156,8 +154,7 @@ describe 'tftp', :type => :class do
     let (:facts) { {  :osfamily         => 'Debian',
                       :operatingsystem  => 'Debian',
                       :path     => '/usr/local/bin:/usr/bin:/bin', } }
-    let (:params) { { :inetd    => true,
-                      :options  => '--secure --timeout 50', } }
+    let (:params) { { :options  => '--secure --timeout 50', } }
     it {
       should include_class('xinetd')
       should contain_xinetd__service('tftp').with({
@@ -180,8 +177,7 @@ describe 'tftp', :type => :class do
     let (:facts) { {  :osfamily         => 'Debian',
                       :operatingsystem  => 'Debian',
                       :path       => '/usr/local/bin:/usr/bin:/bin', } }
-    let (:params) { { :inetd      => true,
-                      :port       => 1069,
+    let (:params) { { :port       => 1069,
                       :address    => '127.0.0.1',
                       :username   => 'root',
                       :directory  => '/tftpboot', } }