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