Project

General

Profile

« Previous | Next » 

Revision 807e29bc

Added by Michael Moll almost 9 years ago

Support FreeBSD

View differences:

manifests/config.pp
class tftp::config {
case $::tftp::params::daemon {
default: { } # not needed for daemon-mode
default: {
file { $::tftp::root:
ensure => directory,
}
if $::osfamily =~ /^(FreeBSD|DragonFly)$/ {
augeas { 'set root directory':
context => '/files/etc/rc.conf',
changes => "set tftpd_flags '\"-s ${::tftp::root}\"'",
}
}
}
false: {
include ::xinetd
manifests/params.pp
}
}
}
/^(FreeBSD|DragonFly)$/: {
$package = 'tftp-hpa'
$daemon = true
$service = 'tftpd'
$root = '/tftpboot'
$syslinux_package = 'syslinux'
}
default: {
fail("${::hostname}: This module does not support osfamily ${::osfamily}")
}
metadata.json
"12.04",
"14.04"
]
},
{
"operatingsystem": "FreeBSD",
"operatingsystemrelease": [
"9",
"10"
]
},
{
"operatingsystem": "DragonFly",
"operatingsystemrelease": [
"3.6",
"3.8",
"4"
]
}
]
}
spec/classes/init_spec.rb
'tftp-server'
when 'Debian'
'tftpd-hpa'
when 'FreeBSD'
'tftp-hpa'
end
should contain_package(tftp_package).with({
......
it 'should not contain the service' do
should_not contain_service('tftpd-hpa')
end
elsif facts[:osfamily] == 'FreeBSD'
it 'should not configure xinetd' do
should_not contain_class('xinetd')
should_not contain_xinetd__service('tftp')
end
it 'should contain the service' do
should contain_service('tftpd').with({
:ensure => 'running',
:enable => true,
:alias => 'tftpd',
:subscribe => 'Class[Tftp::Config]',
})
end
else
it 'should not configure xinetd' do
should_not contain_class('xinetd')

Also available in: Unified diff