diff --git a/roles/dolibarr/tasks/install.yml b/roles/dolibarr/tasks/install.yml index 23c295d..3aefdbe 100644 --- a/roles/dolibarr/tasks/install.yml +++ b/roles/dolibarr/tasks/install.yml @@ -122,6 +122,13 @@ state: "{{ (dolibarr_sync_from_ldap is defined and dolibarr_sync_from_ldap) | ternary('present','absent') }}" tags: dolibarr +- name: Set var_log_t context for log files + sefcontext: + target: '{{ dolibarr_root_dir }}/data/.*\.log' + setype: httpd_log_t + when: ansible_selinux.status == 'enabled' + tags: dolibarr + - name: Install logrotate configuration template: src=logrotate.conf.j2 dest=/etc/logrotate.d/dolibarr_{{ dolibarr_id }} tags: dolibarr diff --git a/roles/dolibarr/templates/logrotate.conf.j2 b/roles/dolibarr/templates/logrotate.conf.j2 index 617823f..2da3ddb 100644 --- a/roles/dolibarr/templates/logrotate.conf.j2 +++ b/roles/dolibarr/templates/logrotate.conf.j2 @@ -1,11 +1,7 @@ -{{ dolibarr_root_dir }}/data/dolibarr.log { +{{ dolibarr_root_dir }}/data/*.log { weekly rotate 52 compress - compressoptions -T0 - compresscmd /usr/bin/xz - compressext .xz - uncompresscmd /usr/bin/unxz missingok create 640 {{ dolibarr_php_user }} {{ dolibarr_php_user }} }