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/init.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/init.pp')
-rw-r--r-- | manifests/init.pp | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 9dfab37..5057eb2 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -31,19 +31,26 @@ class tftp ( $port = $tftp::params::port, $options = $tftp::params::options, $inetd = false, - $inetd_conf = $tftp::params::inetd_conf + $inetd_conf = $tftp::params::inetd_conf, + $package = $tftp::params::package, + $binary = $tftp::params::binary, + $defaults = $tftp::params::defaults ) inherits tftp::params { + package { 'tftpd-hpa': - ensure => present, + ensure => present, + name => $package, } - - file { '/etc/default/tftpd-hpa': - ensure => file, - owner => 'root', - group => 'root', - mode => '0644', - content => template('tftp/tftpd-hpa.erb'), - require => Package['tftpd-hpa'], + if $defaults { + file { '/etc/default/tftpd-hpa': + ensure => file, + owner => 'root', + group => 'root', + mode => '0644', + content => template('tftp/tftpd-hpa.erb'), + require => Package['tftpd-hpa'], + notify => Service['tftpd-hpa'], + } } if $inetd { @@ -77,12 +84,17 @@ class tftp ( $svc_enable = true } + $start = $binary ? { + undef => undef, + default => "${binary} -l -a ${address}:${port} -u ${username} ${options} ${directory}" + } + service { 'tftpd-hpa': ensure => $svc_ensure, enable => $svc_enable, provider => $tftp::params::provider, hasstatus => $tftp::params::hasstatus, pattern => '/usr/sbin/in.tftpd', - subscribe => File['/etc/default/tftpd-hpa'], + start => $start, } } |