summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorJan Örnstedt <jan.ornstedt@postkodlotteriet.se>2014-04-01 12:42:18 +0200
committerJan Örnstedt <jan.ornstedt@postkodlotteriet.se>2014-04-01 12:42:18 +0200
commit2075889875c6b57aa4059ecf68f46c3aa628dbf5 (patch)
treef188e096b9fbd0d340284c4db463b93d4589ea00 /manifests
parenta4abb3df11a8cd46cfe1ee716c4d186725fbca36 (diff)
Added logrotation based on date.
Diffstat (limited to 'manifests')
-rw-r--r--manifests/server.pp14
1 files changed, 13 insertions, 1 deletions
diff --git a/manifests/server.pp b/manifests/server.pp
index beecde3..4fe078a 100644
--- a/manifests/server.pp
+++ b/manifests/server.pp
@@ -38,9 +38,21 @@ class rsyslog::server (
$high_precision_timestamps = false,
$ssl_ca = undef,
$ssl_cert = undef,
- $ssl_key = undef
+ $ssl_key = undef,
+ $rotate = undef,
) inherits rsyslog {
+ ### Logrotate policy
+ $logpath = $rotate ? {
+ 'year' => '/%$YEAR%/',
+ 'YEAR' => '/%$YEAR%/',
+ 'month' => '/%$YEAR%/%$MONTH%/',
+ 'MONTH' => '/%$YEAR%/%$MONTH%/',
+ 'day' => '/%$YEAR%/%$MONTH%/%$DAY%/',
+ 'DAY' => '/%$YEAR%/%$MONTH%/%$DAY%/',
+ default => '/',
+ }
+
$real_content = $custom_config ? {
'' => template("${module_name}/server-default.conf.erb"),
default => template($custom_config),