diff --git a/ansible/roles/common/defaults/main.yml b/ansible/roles/common/defaults/main.yml index 1b947b0caf..60db9bf3ed 100644 --- a/ansible/roles/common/defaults/main.yml +++ b/ansible/roles/common/defaults/main.yml @@ -88,3 +88,6 @@ fluentd_default_volumes: kolla_toolbox_extra_volumes: "{{ default_extra_volumes }}" cron_extra_volumes: "{{ default_extra_volumes }}" fluentd_extra_volumes: "{{ default_extra_volumes }}" + +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 c21e3d1c07..0b0c9b4188 100644 --- a/ansible/roles/common/templates/cron-logrotate-global.conf.j2 +++ b/ansible/roles/common/templates/cron-logrotate-global.conf.j2 @@ -1,6 +1,6 @@ -weekly +{{ cron_logrotate_rotation_interval }} -rotate 6 +rotate {{ cron_logrotate_rotation_count }} copytruncate diff --git a/releasenotes/notes/add-logrotate-configurable-variables-05cb3c5ede5c14fd.yaml b/releasenotes/notes/add-logrotate-configurable-variables-05cb3c5ede5c14fd.yaml new file mode 100644 index 0000000000..957c3e2ff8 --- /dev/null +++ b/releasenotes/notes/add-logrotate-configurable-variables-05cb3c5ede5c14fd.yaml @@ -0,0 +1,6 @@ +--- +features: + - > + Adds configuration variables ``cron_logrotate_rotation_interval`` and + ``cron_logrotate_rotation_count`` to set the logrotate rotation interval + and count.