From acf9c3c190258babc7470743885d0c9acf3567bc Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Thu, 8 Aug 2019 23:19:18 +0200 Subject: [PATCH] fix logrotate config --- defaults/main.yml | 7 ++++--- templates/etc/logrotate.d/config.j2 | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 0f34ed7..c1afeaf 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -52,10 +52,11 @@ matrix_logrotate_config: - log: "{{ matrix_log_dir }}/homeserver.log" options: - weekly - - rotate 4 - - maxsize 250K + - rotate 5 + - maxsize 512K - compress - - shred + - delaycompress + - "create 640 {{ matrix_user }} {{ matrix_group }}" matrix_server_url: example.com matrix_client_url: https://matrix.example.com diff --git a/templates/etc/logrotate.d/config.j2 b/templates/etc/logrotate.d/config.j2 index 4ca5f5b..143734d 100644 --- a/templates/etc/logrotate.d/config.j2 +++ b/templates/etc/logrotate.d/config.j2 @@ -1,10 +1,11 @@ #jinja2: lstrip_blocks: True -# {{ ansible_managed }} +{{ ansible_managed | comment }} {{ item.log }} { {% for option in item.options %} {{ option }} {% endfor %} copytruncate + sharedscripts postrotate /usr/bin/pkill -HUP rsyslogd endscript