aboutsummaryrefslogtreecommitdiff
path: root/manifests/params.pp
blob: b688dd536585a94699a9c0675ba38f72dc9c4c75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Class: tftp::params
#
#   TFTP class parameters.
class tftp::params {
  $address    = '0.0.0.0'
  $port       = '69'
  $options    = '--secure'
  $inetd_conf = '/etc/inetd.conf'

  case $::osfamily {
    'debian': {
      $package  = 'tftpd-hpa'
      $defaults = true
      $binary   = undef
      $username = 'tftp'
      case $::operatingsystem {
        'debian': {
          $directory  = '/srv/tftp'
          $hasstatus  = false
          $provider   = undef
        }
        'ubuntu': {
          $directory  = '/var/lib/tftpboot'
          $hasstatus  = true
          $provider   = 'upstart'
        }
        default: {
          $directory  = '/var/lib/tftpboot'
          $hasstatus  = true
          $provider   = undef
          warning("tftp:: cannot determine settings for $::operatingsystem")
        }
      }
    }
    'redhat': {
      $package    = 'tftp-server'
      $username   = 'nobody'
      $defaults   = false
      $directory  = '/var/lib/tftpboot'
      $hasstatus  = false
      $provider   = 'base'
      $binary     = '/usr/sbin/in.tftpd'
    }
    default: {
      $package    = 'tftpd'
      $username   = 'nobody'
      $defaults   = false
      $hasstatus  = false
      $provider   = undef
      $binary     = '/usr/sbin/in.tftpd'
      warning("tftp:: $::operatingsystem may not be supported")
    }
  }

}