xymon/manifests/server/preconfig.pp

54 lines
1.5 KiB
Puppet

# == Class: xymon::server::preconfig
#
# Some configurations before install Xymon server
#
class xymon::server::preconfig {
# If the Xymon client should be managed too
if (! defined(Class['::xymon::client'])) and ($xymon::server::manage_client == true) {
class { '::xymon::client':
service_enabled => false,
new_version => $xymon::server::new_version,
}
}
# Define the download URL
if $xymon::server::download_url == undef {
case $::osfamily {
'Debian': {
# From Xymon project via Sourceforge
$dl_url = "http://ufpr.dl.sourceforge.net/project/xymon/Xymon/${xymon::server::new_version}"
}
default: {
fail('Please define a download_url.')
}
}
} else {
$dl_url = $xymon::server::download_url
}
# Define the package name
if $xymon::server::package_name == undef {
case $::osfamily {
'Debian': {
$pkg_name = "xymon_${xymon::server::new_version}_${::architecture}.deb"
}
default: {
fail('Please define a package_name.')
}
}
} else {
$pkg_name = $xymon::server::package_name
}
#http://ufpr.dl.sourceforge.net/project/xymon/Xymon/4.3.17/xymon_4.3.17_amd64.deb
exec { 'Create download directory for Xymon server package':
path => [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ],
command => "mkdir -p -- ${xymon::server::download_dir}",
creates => $xymon::server::download_dir,
logoutput => 'on_failure',
}
} # Private class: xymon::server::preconfig