Enable to modify params of logrotate-crond.conf

Parameters "minsize" and "notifempty" of /etc/logrotate-crond.conf
in the container logrotate_crond should be changeable even if this
doesn't	comply with GDPR. This is because there might be users who
don't want to comply with it for some reason such as their internal
rule, testing purpose, etc.

This patch adds the following Puppet hieradata.

tripleo::profile::base::logging::logrotate::minsize (default: 1)
tripleo::profile::base::logging::logrotate::notifempty (default: True)

Change-Id: I623c711921cf7fe52f15cc1ba4a1dafb3c9479b7
Closes-Bug: #1884415
(cherry picked from commit f6f878d4b3)
This commit is contained in:
Ryo Hayakawa 2020-06-21 22:37:09 +09:00 committed by Emilien Macchi
parent fe9ae10c4a
commit c2899322dd
2 changed files with 13 additions and 1 deletions

View File

@ -62,10 +62,18 @@
# (optional) Defaults to True. # (optional) Defaults to True.
# Configures the logrotate compress parameter. # Configures the logrotate compress parameter.
# #
# [*minsize*]
# (optional) Defaults to '1'.
# Configures the logrotate minsize parameter.
#
# [*maxsize*] # [*maxsize*]
# (optional) Defaults to '10M'. # (optional) Defaults to '10M'.
# Configures the logrotate maxsize parameter. # Configures the logrotate maxsize parameter.
# #
# [*notifempty*]
# (optional) Defaults to True.
# Configures the logrotate notifempty parameter.
#
# [*rotation*] # [*rotation*]
# (optional) Defaults to 'daily'. # (optional) Defaults to 'daily'.
# Configures the logrotate rotation interval. # Configures the logrotate rotation interval.
@ -111,7 +119,9 @@ class tripleo::profile::base::logging::logrotate (
$delaycompress = true, $delaycompress = true,
$compress = true, $compress = true,
$rotation = 'daily', $rotation = 'daily',
$minsize = 1,
$maxsize = '10M', $maxsize = '10M',
$notifempty = true,
$rotate = 14, $rotate = 14,
$purge_after_days = 14, $purge_after_days = 14,
$dateext = undef, $dateext = undef,

View File

@ -4,12 +4,14 @@
maxage <%= @purge_after_days %> maxage <%= @purge_after_days %>
# minsize 1 is required for GDPR compliance, all files in # minsize 1 is required for GDPR compliance, all files in
# /var/log/containers not managed with logrotate will be purged! # /var/log/containers not managed with logrotate will be purged!
minsize 1 minsize <%= @minsize %>
# Do not use size as it's not compatible with time-based rotation rules # Do not use size as it's not compatible with time-based rotation rules
# required for GDPR compliance. # required for GDPR compliance.
maxsize <%= @maxsize %> maxsize <%= @maxsize %>
missingok missingok
<%- if @notifempty %>
notifempty notifempty
<%- end %>
<%- if @copytruncate %> <%- if @copytruncate %>
copytruncate copytruncate
<%- end %> <%- end %>