Skip to content

Commit

Permalink
fix voxpupuli#250 replace service restart with reload
Browse files Browse the repository at this point in the history
  • Loading branch information
lbetz authored and n00by committed Apr 26, 2018
1 parent 71ad732 commit 757267f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 5 additions & 3 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
Expand Down Expand Up @@ -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',
Expand Down
10 changes: 8 additions & 2 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down

0 comments on commit 757267f

Please sign in to comment.