Cannot change "minsize" and "notifempty" of /etc/logrotate-crond.conf.

Bug #1884415 reported by Ryo Hayakawa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Wishlist
Ryo Hayakawa

Bug Description

We cannot change parameters "minsize" and "notifempty" of /etc/logrotate-crond.conf in the container logrotate_crond.
This is because parameters "minsize" and "notifempty" are hard coded in the template file[1].

I think this implementation is probably in order to comply with GDPR, but there might be users who don't want to comply with it for some reason such as their internal rule, testing purpose, etc.
Thus, in my opinion, these parameters should be changeable like[2].

Thanks,

[1] templates/logrotate/containers_logrotate.conf.erb
/var/log/containers/*/*log /var/log/containers/*/*/*log /var/log/containers/*/*err {
  <%= @rotation %>
  rotate <%= @rotate %>
  maxage <%= @purge_after_days %>
  # minsize 1 is required for GDPR compliance, all files in
  # /var/log/containers not managed with logrotate will be purged!
  minsize 1
  # Do not use size as it's not compatible with time-based rotation rules
  # required for GDPR compliance.
  maxsize <%= @maxsize %>
  missingok
  notifempty
<%- if @copytruncate %>
  copytruncate
<%- end %>
<%- if @delaycompress %>
  delaycompress
<%- end %>
<%- if @compress %>
  compress
<%- end %>
<%- if @dateext %>
  dateext
<%- if @dateformat %>
  dateformat <%= @dateformat %>
<%- end %>
<%- if @dateyesterday %>
  dateyesterday
<%- end %>
<%- end %>
}

[2] my proposal:
--- /usr/share/openstack-puppet/modules/tripleo/manifests/profile/base/logging/logrotate.pp 2020-03-24 04:50:47.000000000 +0900
+++ logrotate.pp 2020-06-21 15:39:43.000000000 +0900
@@ -62,10 +62,18 @@
 # (optional) Defaults to True.
 # Configures the logrotate compress parameter.
 #
+# [*minsize*]
+# (optional) Defaults to '1'.
+# Configures the logrotate minsize parameter.
+#
 # [*maxsize*]
 # (optional) Defaults to '10M'.
 # Configures the logrotate maxsize parameter.
 #
+# [*notifempty*]
+# (optional) Defaults to True.
+# Configures the logrotate notifempty parameter.
+#
 # [*rotation*]
 # (optional) Defaults to 'daily'.
 # Configures the logrotate rotation interval.
@@ -111,7 +119,9 @@
   $delaycompress = true,
   $compress = true,
   $rotation = 'daily',
+ $minsize = 1,
   $maxsize = '10M',
+ $notifempty = true,
   $rotate = 14,
   $purge_after_days = 14,
   $dateext = undef,

--- /usr/share/openstack-puppet/modules/tripleo/templates/logrotate/containers_logrotate.conf.erb 2020-03-24 04:50:47.000000000 +0900
+++ containers_logrotate.conf.erb 2020-06-21 15:39:03.000000000 +0900
@@ -4,12 +4,14 @@
   maxage <%= @purge_after_days %>
   # minsize 1 is required for GDPR compliance, all files in
   # /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
   # required for GDPR compliance.
   maxsize <%= @maxsize %>
   missingok
+<%- if @notifempty %>
   notifempty
+<%- end %>
 <%- if @copytruncate %>
   copytruncate
 <%- end %>

Changed in tripleo:
assignee: nobody → Ryo Hayakawa (ryohayakawa)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-tripleo (master)

Fix proposed to branch: master
Review: https://review.opendev.org/737181

Changed in tripleo:
status: New → In Progress
Changed in tripleo:
importance: Undecided → Wishlist
milestone: none → victoria-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-tripleo (master)

Reviewed: https://review.opendev.org/737181
Committed: https://git.openstack.org/cgit/openstack/puppet-tripleo/commit/?id=f6f878d4b36540ecc8b99552d3f5d14d92d509df
Submitter: Zuul
Branch: master

commit f6f878d4b36540ecc8b99552d3f5d14d92d509df
Author: Ryo Hayakawa <email address hidden>
Date: Sun Jun 21 22:37:09 2020 +0900

    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

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-tripleo (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/739090

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-tripleo (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/739091

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-tripleo (stable/ussuri)

Reviewed: https://review.opendev.org/739090
Committed: https://git.openstack.org/cgit/openstack/puppet-tripleo/commit/?id=7097c48b117c17125987b1b99a56170747004713
Submitter: Zuul
Branch: stable/ussuri

commit 7097c48b117c17125987b1b99a56170747004713
Author: Ryo Hayakawa <email address hidden>
Date: Sun Jun 21 22:37:09 2020 +0900

    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 f6f878d4b36540ecc8b99552d3f5d14d92d509df)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-tripleo (stable/train)

Reviewed: https://review.opendev.org/739091
Committed: https://git.openstack.org/cgit/openstack/puppet-tripleo/commit/?id=c2899322dd96a3b18834cea0fd2f2dff418aeb45
Submitter: Zuul
Branch: stable/train

commit c2899322dd96a3b18834cea0fd2f2dff418aeb45
Author: Ryo Hayakawa <email address hidden>
Date: Sun Jun 21 22:37:09 2020 +0900

    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 f6f878d4b36540ecc8b99552d3f5d14d92d509df)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/puppet-tripleo 11.5.0

This issue was fixed in the openstack/puppet-tripleo 11.5.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.