diff --git a/tftp/manifests/init.pp b/tftp/manifests/init.pp index 42f770c..1ff8dc6 100644 --- a/tftp/manifests/init.pp +++ b/tftp/manifests/init.pp @@ -39,24 +39,31 @@ class tftp::server { } case $::operatingsystem { - debian,fedora,ubuntu: { - file { "/var/lib/tftpboot": - ensure => link, - target => "/srv/tftpboot", - force => true, - require => File["/srv/tftpboot"], + "debian","fedora","ubuntu": { + $tftpdir = "/var/lib/tftpboot" + } + "centos","redhat": { + case $::operatingsystemrelease { + /^[45]\./: { + $tftpdir = "/tftpboot" + } + default: { + $tftpdir = "/var/lib/tftpboot" + } } } default: { - file { "/tftpboot": - ensure => link, - target => "/srv/tftpboot", - force => true, - require => File["/srv/tftpboot"], - } + $tftpdir = "/tftpboot" } } + file { $tftpdir: + ensure => link, + target => "/srv/tftpboot", + force => true, + require => File["/srv/tftpboot"], + } + if "${selinux}" == "true" { selinux::manage_fcontext { "/srv/tftpboot(/.*)?": type => "tftpdir_t",