diff --git a/manifests/params.pp b/manifests/params.pp index 159fcf293..b150f6c38 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -92,12 +92,13 @@ $ca_dir = '/var/lib/icinga2/ca' $ido_pgsql_package = 'icinga2-ido-pgsql' $ido_mysql_package = 'icinga2-ido-mysql' + $service_reload = "service ${service} reload" case $::osfamily { 'redhat': { - $user = 'icinga' - $group = 'icinga' - $lib_dir = $::architecture ? { + $user = 'icinga' + $group = 'icinga' + $lib_dir = $::architecture ? { 'x86_64' => '/usr/lib64', default => '/usr/lib', } @@ -169,6 +170,7 @@ $lib_dir = '/usr/local/lib/icinga2' $ido_pgsql_package = undef $ido_mysql_package = undef + $service_reload = "service ${service} reload" $constants = { 'PluginDir' => '/usr/local/libexec/nagios', diff --git a/manifests/service.pp b/manifests/service.pp index 56f0d9224..0c6977b46 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -24,11 +24,17 @@ $enable = $::icinga2::enable $manage_service = $::icinga2::manage_service $service = $::icinga2::params::service + $reload = $::icinga2::params::service_reload if $manage_service { service { $service: - ensure => $ensure, - enable => $enable, + ensure => $ensure, + enable => $enable, + hasrestart => $reload ? { + undef => false, + default => true, + }, + restart => $reload, } }