Add dateext and related parameters for logrotate

logrotate.pp should support dateext and related parameters.
By this change, a filename of a rotated file can be easily distinguished
by rotated date.

Change-Id: I798304a472df41b86a88611c97c2c99131faa0ad
(cherry picked from commit 1eafeb67bf)
(cherry picked from commit 964fe8cc62)
(cherry picked from commit 9d62bf52a4)
This commit is contained in:
Keigo Noha 2019-07-08 14:34:47 +09:00
parent 9f6cbedae6
commit c939f4e61d
3 changed files with 29 additions and 0 deletions

View File

@ -79,6 +79,18 @@
# Configures forced purge period for rotated logs.
# Overrides the rotation and rotate settings.
#
# [*dateext*]
# (optional) Defaults to undef.
# Configures the dateext parameter.
#
# [*dateformat*]
# (optional) Defaults to undef.
# Configures the dateformat parameter used with dateext parameter.
#
# [*dateyesterday*]
# (optional) Defaults to undef.
# Configures the dateyesterday parameter used with dateext parameter.
#
# DEPRECATED PARAMETERS
#
# [*size*]
@ -102,6 +114,9 @@ class tripleo::profile::base::logging::logrotate (
$maxsize = '10M',
$rotate = 14,
$purge_after_days = 14,
$dateext = undef,
$dateformat = undef,
$dateyesterday = undef,
# DEPRECATED PARAMETERS
$size = undef,
) {

View File

@ -0,0 +1,5 @@
---
other:
- |
Add dateext and related paramters for containerized logrotate service to
find easily when logfiles were rotated.

View File

@ -19,4 +19,13 @@
<%- if @compress %>
compress
<%- end %>
<%- if @dateext %>
dateext
<%- if @dateformat %>
dateformat <%= @dateformat %>
<%- end %>
<%- if @dateyesterday %>
dateyesterday
<%- end %>
<%- end %>
}