Add a logrotate entry. Move the default logs dir to /var/log/roundcube

This commit is contained in:
Andrea Dell'Amico 2020-10-12 16:03:11 +02:00
parent 42447ba066
commit bed00b1db0
4 changed files with 24 additions and 6 deletions

View File

@ -1,15 +1,17 @@
Role Name
ansible-role-roundcube
=========
A role that installs the RoundCube webmail, <https://roundcube.net/>
To upgrade, run the playbook with the following options: `-e roundcube_upgrade=True -e roundcube_old_version='version_number'`
Role Variables
--------------
The most important variables are listed below:
``` yaml
roundcube_version: 1.4.7
roundcube_version: 1.4.9
roundcube_upgrade: False
roundcube_dist: 'roundcubemail-{{ roundcube_version }}'
roundcube_dist_filename: '{{ roundcube_dist }}-complete.tar.gz'
@ -59,7 +61,11 @@ roundcube_memcache_hosts:
Dependencies
------------
None
* php-fpm
* nginx
* redis (optional)
* memcached (optional)
* postgresql (optional)
License
-------

View File

@ -1,5 +1,5 @@
---
roundcube_version: 1.4.7
roundcube_version: 1.4.9
roundcube_upgrade: False
roundcube_dist: 'roundcubemail-{{ roundcube_version }}'
roundcube_dist_filename: '{{ roundcube_dist }}-complete.tar.gz'
@ -11,7 +11,7 @@ roundcube_web_basedir: /var/www/html
roundcube_web_root: '{{ roundcube_web_basedir }}/roundcube'
roundcube_data_base_dir: /srv
roundcube_data_dir: '{{ roundcube_data_base_dir }}/roundcube'
roundcube_logs_dir: '{{ roundcube_data_dir }}/logs'
roundcube_logs_dir: '/var/log/roundcube'
roundcube_temp_dir: '{{ roundcube_data_dir }}/temp'
roundcube_skin_logo: 'null'

View File

@ -21,6 +21,10 @@
- '{{ roundcube_logs_dir }}'
- '{{ roundcube_temp_dir }}'
- name: Install a logrotate entry for the roundcube logs
template: src=roundcube-logrotate.j2 dest=/etc/logrotate.d/roundcube mode='0644' owner=root group=root
tags: [ 'roundcube', 'roundcube_logrotate' ]
- name: Unpack the roundcube archive
unarchive: remote_src=yes src={{ roundcube_download_url }} dest={{ roundcube_data_dir }} owner=root group=root
args:
@ -90,4 +94,3 @@
- roundcube_old_version is defined
- roundcube_upgrade | bool
tags: [ 'roundcube', 'roundcube_upgrade' ]

View File

@ -0,0 +1,9 @@
{{ roundcube_logs_dir }}/*.log {
weekly
missingok
rotate 52
compress
maxsize 1G
notifempty
create 0640 {{ roundcube_user }} {{ roundcube_user }}
}