From 40efa84fcf7179061c0c41110656cf6d55ecc29d Mon Sep 17 00:00:00 2001 From: Markus Hauschild Date: Mon, 4 Feb 2019 20:31:13 +0100 Subject: [PATCH] dovecot: add logrotate config --- roles/mail/files/logrotate.d/dovecot | 12 ++++++++++++ roles/mail/tasks/main.yml | 3 +++ 2 files changed, 15 insertions(+) create mode 100644 roles/mail/files/logrotate.d/dovecot diff --git a/roles/mail/files/logrotate.d/dovecot b/roles/mail/files/logrotate.d/dovecot new file mode 100644 index 0000000..e96f8d5 --- /dev/null +++ b/roles/mail/files/logrotate.d/dovecot @@ -0,0 +1,12 @@ +/var/log/dovecot/*.log { + weekly + rotate 4 + missingok + notifempty + compress + delaycompress + sharedscripts + postrotate + doveadm log reopen + endscript +} diff --git a/roles/mail/tasks/main.yml b/roles/mail/tasks/main.yml index af3e664..daeb38f 100644 --- a/roles/mail/tasks/main.yml +++ b/roles/mail/tasks/main.yml @@ -46,6 +46,9 @@ - dovecot/local.conf notify: Restart dovecot +- name: Configure logrotate for dovecot + copy: src=logrotate.d/dovecot dest=/etc/logrotate.d/dovecot + - name: Ensure dovecot certificates are available command: openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/dovecot/ssl/{{ mail_server }}.key -out /etc/dovecot/ssl/{{ mail_server }}.crt -days 730 -subj "/CN={{ mail_server }}" creates=/etc/dovecot/ssl/{{ mail_server }}.crt notify: Restart dovecot