2026-02-10 14:04:06 +01:00
|
|
|
## confdroid_nagios::server::service.pp
|
|
|
|
|
# Module name: confdroid_nagios
|
|
|
|
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
2026-02-13 19:29:23 +01:00
|
|
|
# @summary Class manages services for the confdroid_nagios module.
|
2026-02-10 14:04:06 +01:00
|
|
|
###############################################################################
|
|
|
|
|
class confdroid_nagios::server::service (
|
|
|
|
|
|
|
|
|
|
) inherits confdroid_nagios::params {
|
2026-02-13 14:57:03 +01:00
|
|
|
require confdroid_nagios::server::files
|
2026-02-14 20:10:14 +01:00
|
|
|
if $ng_nagios_server == $fqdn {
|
2026-02-14 21:23:22 +01:00
|
|
|
require confdroid_nagios::server::access_rules
|
2026-03-01 14:34:53 +01:00
|
|
|
require confdroid_nagios::nagios::config
|
2026-03-10 11:14:24 +01:00
|
|
|
require confdroid_nagios::server::nagios
|
2026-02-28 16:16:59 +01:00
|
|
|
|
2026-03-01 14:21:30 +01:00
|
|
|
exec { 'ng_restart_httpd':
|
2026-02-14 21:43:49 +01:00
|
|
|
command => 'systemctl restart httpd',
|
2026-02-14 20:36:59 +01:00
|
|
|
path => ['/bin', '/usr/bin', '/sbin', '/usr/sbin'],
|
|
|
|
|
refreshonly => true,
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-01 18:40:19 +01:00
|
|
|
service { $ng_service:
|
2026-02-14 20:10:14 +01:00
|
|
|
ensure => running,
|
2026-03-01 18:40:19 +01:00
|
|
|
name => $ng_service,
|
2026-02-14 20:10:14 +01:00
|
|
|
enable => true,
|
|
|
|
|
hasrestart => true,
|
|
|
|
|
hasstatus => true,
|
2026-03-01 14:21:30 +01:00
|
|
|
require => Exec['ng_restart_httpd'],
|
2026-02-14 20:10:14 +01:00
|
|
|
}
|
|
|
|
|
}
|
2026-02-10 14:04:06 +01:00
|
|
|
}
|