# Install tftp server # # === Global variables: # # $tftp_datadir: # Directory containing tftp files. # class tftp::server { include inetd::server if $tftp_datadir { file { "${tftp_datadir}": ensure => directory, mode => 0755, owner => root, group => root, seltype => "tftpdir_t", } file { "/srv/tftpboot": ensure => link, target => "${tftp_datadir}", seltype => "tftpdir_t", require => File["${tftp_datadir}"], } } else { file { "/srv/tftpboot": ensure => directory, mode => 0755, owner => root, group => root, seltype => "tftpdir_t", } } if $operatingsystem == "Fedora" { file { "/var/lib/tftpboot": ensure => link, target => "/srv/tftpboot", force => true, require => File["/srv/tftpboot"], } } else { file { "/tftpboot": ensure => link, target => "/srv/tftpboot", force => true, require => File["/srv/tftpboot"], } } if $selinux { selinux::manage_fcontext { "/srv/tftpboot(/.*)?": type => "tftpdir_t", before => File["/srv/tftpboot"], } if $tftp_datadir { selinux::manage_fcontext { "${tftp_datadir}(/.*)?": type => "tftpdir_t", before => File["${tftp_datadir}"], } } } package { "tftp-server": ensure => installed, } inetd::service { "tftp": ensure => present, require => Package["tftp-server"], } } # Install tftp client tools # class tftp::client { package { "tftp": ensure => installed, } }