Add a new subclass: xymon::client::service : to manage the Xymon client
service.
This commit is contained in:
parent
8f2174bc06
commit
d1c86d8894
@ -28,6 +28,8 @@ class xymon::client (
|
||||
$package_name = $xymon::params::cli_package_name,
|
||||
$pkg_ensure = $xymon::params::cli_pkg_ensure,
|
||||
$pkg_provider = $xymon::params::cli_pkg_provider,
|
||||
$service_enabled = $xymon::params::cli_service_enabled,
|
||||
$service_managed = $xymon::params::cli_service_managed,
|
||||
$service_name = $xymon::params::cli_service_name,
|
||||
$service_default_path = $xymon::params::cli_service_default_path,
|
||||
$service_path = $xymon::params::cli_service_path,
|
||||
@ -37,9 +39,11 @@ class xymon::client (
|
||||
include '::xymon::client::preconfig'
|
||||
include '::xymon::client::install'
|
||||
include '::xymon::client::config'
|
||||
include '::xymon::client::service'
|
||||
|
||||
Class['::xymon::client::preconfig'] ->
|
||||
Class['::xymon::client::install'] ->
|
||||
Class['::xymon::client::config']
|
||||
Class['::xymon::client::config'] ->
|
||||
Class['::xymon::client::service']
|
||||
|
||||
} # Public class: xymon::client
|
||||
|
@ -14,6 +14,7 @@ class xymon::client::config {
|
||||
ensure => present,
|
||||
mode => 0754,
|
||||
content => template($xymon::client::service_tpl),
|
||||
notify => Service[$xymon::client::service_name],
|
||||
}
|
||||
|
||||
|
||||
|
23
manifests/client/service.pp
Normal file
23
manifests/client/service.pp
Normal file
@ -0,0 +1,23 @@
|
||||
# == Class: xymon::client::service
|
||||
#
|
||||
# Manage Xymon client service
|
||||
#
|
||||
class xymon::client::service {
|
||||
|
||||
if $xymon::client::service_enabled == true {
|
||||
$service_ensure = 'running'
|
||||
} else {
|
||||
$service_ensure = 'stopped'
|
||||
}
|
||||
|
||||
if $xymon::client::service_managed == true {
|
||||
service { $xymon::client::service_name:
|
||||
ensure => $service_ensure,
|
||||
enable => $xymon::client::service_enabled,
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} # Private class: xymon::client::service
|
@ -14,6 +14,8 @@ class xymon::params {
|
||||
$cli_pkg_provider = 'dpkg'
|
||||
|
||||
# Service
|
||||
$cli_service_enabled = true
|
||||
$cli_service_managed = true
|
||||
$cli_service_name = 'xymon-client'
|
||||
$cli_service_default_path = '/etc/default/xymon-client'
|
||||
$cli_service_path = '/etc/init.d/xymon-client'
|
||||
|
Loading…
Reference in New Issue
Block a user