Add the possibility to choose if the server's subclass should manage the

client's subsclass. And add the client as a dependencie to install Xymon
server.
This commit is contained in:
gardouille 2015-02-20 12:17:18 +01:00
parent 749c64a936
commit 05cc473245
4 changed files with 13 additions and 7 deletions

View File

@ -47,6 +47,8 @@ class xymon::params {
$srv_pkg_ensure = 'present'
$srv_pkg_provider = 'dpkg'
# If the server subclass should manage the client one
$manage_client = true
}
default: {
fail('This Puppet module has been tested only on Debian OS family.')

View File

@ -29,14 +29,9 @@ class xymon::server (
$package_name = $xymon::params::srv_package_name,
$pkg_ensure = $xymon::params::srv_pkg_ensure,
$pkg_provider = $xymon::params::srv_pkg_provider,
$manage_client = $xymon::params::manage_client,
) inherits xymon::params {
if ! defined(Class['::xymon::client']) {
class { '::xymon::client':
service_enabled => false,
}
}
include '::xymon::server::preconfig'
include '::xymon::server::install'
#include '::xymon::server::config'

View File

@ -22,10 +22,11 @@ class xymon::server::install {
}
->
# Install Xymon server package
package { 'xymon-server':
package { 'xymon':
ensure => $xymon::server::pkg_ensure,
provider => $xymon::server::pkg_provider,
source => "${xymon::server::download_dir}/${xymon::server::preconfig::pkg_name}",
require => [ Package[$xymon::server::dep_pkg_name], Class['::xymon::client'] ],
}

View File

@ -4,6 +4,14 @@
#
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 {