From f3d5425808f1568916fdc74ed49d71fd5531ffef Mon Sep 17 00:00:00 2001 From: Michal Arbet Date: Fri, 24 Sep 2021 13:37:37 +0200 Subject: [PATCH] Make cron logfile minsize,maxsize configurable This patch is moving minsize and maxsize logrotate options to defaults and use them in template. Change-Id: Ic2dfc747faedef8a7a4bc5e61db7c0cb5bf93e88 --- ansible/roles/common/defaults/main.yml | 2 ++ .../roles/common/templates/cron-logrotate-global.conf.j2 | 4 ++-- .../notes/cron-minsize-maxsize-c647add8e8156b79.yaml | 7 +++++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/cron-minsize-maxsize-c647add8e8156b79.yaml diff --git a/ansible/roles/common/defaults/main.yml b/ansible/roles/common/defaults/main.yml index b68c8be3b4..36a6059961 100644 --- a/ansible/roles/common/defaults/main.yml +++ b/ansible/roles/common/defaults/main.yml @@ -95,6 +95,8 @@ kolla_toolbox_extra_volumes: "{{ default_extra_volumes }}" cron_extra_volumes: "{{ default_extra_volumes }}" fluentd_extra_volumes: "{{ default_extra_volumes }}" +cron_logrotate_log_maxsize: "100M" +cron_logrotate_log_minsize: "30M" cron_logrotate_rotation_interval: "weekly" cron_logrotate_rotation_count: 6 diff --git a/ansible/roles/common/templates/cron-logrotate-global.conf.j2 b/ansible/roles/common/templates/cron-logrotate-global.conf.j2 index fa1c7d3937..f57a2e0347 100644 --- a/ansible/roles/common/templates/cron-logrotate-global.conf.j2 +++ b/ansible/roles/common/templates/cron-logrotate-global.conf.j2 @@ -12,9 +12,9 @@ notifempty missingok -minsize 30M +minsize {{ cron_logrotate_log_minsize }} -maxsize 100M +maxsize {{ cron_logrotate_log_maxsize }} su root kolla diff --git a/releasenotes/notes/cron-minsize-maxsize-c647add8e8156b79.yaml b/releasenotes/notes/cron-minsize-maxsize-c647add8e8156b79.yaml new file mode 100644 index 0000000000..c2b8bf425f --- /dev/null +++ b/releasenotes/notes/cron-minsize-maxsize-c647add8e8156b79.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + Adds new variables to be used by the common role, + ``cron_logrotate_log_minsize`` and ``cron_logrotate_log_maxsize``. + They allow to configure global logrotate's minsize and maxsize + options.