diff options
author | crayfishx <craig@craigdunn.org> | 2012-07-10 12:51:23 -0700 |
---|---|---|
committer | crayfishx <craig@craigdunn.org> | 2012-07-10 12:51:23 -0700 |
commit | 408f02ba9cb24804a09462ce5448c49bf1c0c8ca (patch) | |
tree | 2957700e3427b026a1732b63a330f6806c2ffddc /manifests/params.pp | |
parent | f8f6723253b8c34577e8eeb0b5bd2364b24dca4a (diff) | |
download | puppet-tftp-408f02ba9cb24804a09462ce5448c49bf1c0c8ca.tar.gz puppet-tftp-408f02ba9cb24804a09462ce5448c49bf1c0c8ca.tar.bz2 |
Add EL (RHEL/CentOS) support for tftp.
* EL tftpd-hpa package is called tftp-server
* Distributed RPM doesn't provide an init file so the base provider is needed
* Default username for tftp-server on RHEL is nobody
* no /etc/default/tftpd-hpa should be pushed for EL systems
Diffstat (limited to 'manifests/params.pp')
-rw-r--r-- | manifests/params.pp | 54 |
1 files changed, 39 insertions, 15 deletions
diff --git a/manifests/params.pp b/manifests/params.pp index e658184..b688dd5 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -4,28 +4,52 @@ class tftp::params { $address = '0.0.0.0' $port = '69' - $username = 'tftp' $options = '--secure' $inetd_conf = '/etc/inetd.conf' - case $::operatingsystem { + case $::osfamily { 'debian': { - # hasstatus is to get around an issue where the service script appears to - # be broken. - $directory = '/srv/tftp' - $hasstatus = false - $provider = undef + $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") + } + } } - 'ubuntu': { - $directory = '/var/lib/tftpboot' - $hasstatus = true - $provider = 'upstart' + 'redhat': { + $package = 'tftp-server' + $username = 'nobody' + $defaults = false + $directory = '/var/lib/tftpboot' + $hasstatus = false + $provider = 'base' + $binary = '/usr/sbin/in.tftpd' } default: { - warning("tftp:: not verified on operatingsystem ${::operatingsystem}.") - $directory = '/var/lib/tftpboot' - $hasstatus = true - $provider = undef + $package = 'tftpd' + $username = 'nobody' + $defaults = false + $hasstatus = false + $provider = undef + $binary = '/usr/sbin/in.tftpd' + warning("tftp:: $::operatingsystem may not be supported") } } + } |