diff options
author | Jan Örnstedt <jan.ornstedt@postkodlotteriet.se> | 2014-04-01 12:42:18 +0200 |
---|---|---|
committer | Jan Örnstedt <jan.ornstedt@postkodlotteriet.se> | 2014-04-01 12:42:18 +0200 |
commit | 2075889875c6b57aa4059ecf68f46c3aa628dbf5 (patch) | |
tree | f188e096b9fbd0d340284c4db463b93d4589ea00 /manifests | |
parent | a4abb3df11a8cd46cfe1ee716c4d186725fbca36 (diff) |
Added logrotation based on date.
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/server.pp | 14 |
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), |