31 lines
966 B
Puppet
31 lines
966 B
Puppet
## confdroid_nagios::server::service.pp
|
|
# Module name: confdroid_nagios
|
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
|
# @summary Class manages services for the confdroid_nagios module.
|
|
###############################################################################
|
|
class confdroid_nagios::server::service (
|
|
|
|
) inherits confdroid_nagios::params {
|
|
require confdroid_nagios::server::files
|
|
if $ng_nagios_server == $fqdn {
|
|
require confdroid_nagios::server::access_rules
|
|
require confdroid_nagios::nagios::config
|
|
require confdroid_nagios::server::nagios
|
|
|
|
exec { 'ng_restart_httpd':
|
|
command => 'systemctl restart httpd',
|
|
path => ['/bin', '/usr/bin', '/sbin', '/usr/sbin'],
|
|
refreshonly => true,
|
|
}
|
|
|
|
service { $ng_service:
|
|
ensure => running,
|
|
name => $ng_service,
|
|
enable => true,
|
|
hasrestart => true,
|
|
hasstatus => true,
|
|
require => Exec['ng_restart_httpd'],
|
|
}
|
|
}
|
|
}
|