forked from faxm0dem/puppet-syslog_ng
-
Notifications
You must be signed in to change notification settings - Fork 1
/
reload.pp
34 lines (28 loc) · 1004 Bytes
/
reload.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# @summary Manage syslog-ng configuration reloading
#
# @api private
class syslog_ng::reload (
Boolean $syntax_check_before_reloads = true,
) {
assert_private()
include syslog_ng
$config_file = $syslog_ng::config_file
$exec_path = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:'
$syslog_ng_ctl_full_path = "${syslog_ng::sbin_path}/syslog-ng-ctl"
$syslog_ng_full_path = "${syslog_ng::sbin_path}/syslog-ng"
$syslog_ng_syntax_check_cmd = "${syslog_ng_full_path} --syntax-only --cfgfile %"
exec { 'syslog_ng_reload':
command => "${syslog_ng_ctl_full_path} reload",
path => $exec_path,
refreshonly => true,
try_sleep => 1,
logoutput => true,
require => Service[$syslog_ng::service_name],
}
if $syntax_check_before_reloads {
Concat <| title == $config_file |> { validate_cmd => $syslog_ng_syntax_check_cmd }
} else {
Concat <| title == $config_file |>
}
Concat[$config_file] ~> Exec['syslog_ng_reload']
}