logwatch: Added support for setting detail level.

This commit is contained in:
Timo Mkinen 2013-06-18 13:32:51 +03:00
parent 1bf60c5bdc
commit 49073dcc57
2 changed files with 19 additions and 10 deletions

View file

@ -2,9 +2,13 @@
#
# === Global variables
#
# $logwatch_mailto
# $logwatch_mailto:
# Logwatch mail recipient.
#
# $logwatch_level:
# Logwatch detail level for report. Valid values are
# from 0 to 10.
#
class logwatch {
case $::kernel {
@ -18,15 +22,13 @@ class logwatch {
}
}
if $logwatch_mailto {
file { "/etc/logwatch/conf/logwatch.conf":
ensure => present,
mode => "0644",
owner => "root",
group => "root",
content => "MailTo = ${logwatch_mailto}\n",
require => Package["logwatch"],
}
file { "/etc/logwatch/conf/logwatch.conf":
ensure => present,
content => template("logwatch/logwatch.conf.erb"),
mode => "0644",
owner => "root",
group => "root",
require => Package["logwatch"],
}
}

View file

@ -0,0 +1,7 @@
# autogenerated by puppet
<% if @logwatch_mailto -%>
MailTo = <%= @logwatch_mailto %>
<% end -%>
<% if @logwatch_level -%>
Detail = <%= @logwatch_level %>
<% end -%>