diff --git a/tasks/main.yml b/tasks/main.yml index a963e7f..8974434 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -28,13 +28,26 @@ username: "{{ docker_hub_username }}" password: "{{ docker_hub_token }}" +- name: Create group php-fpm on host (require to store logs) + ansible.builtin.group: + gid: 82 + name: php-fpm + system: true + +- name: Create user php-fpm on host (required to store logs) + ansible.builtin.user: + uid: 82 + group: php-fpm + name: php-fpm + create_home: false + system: true - name: Create log directory ansible.builtin.file: path: /var/log/chill state: directory - owner: 33 - group: 33 + owner: php-fpm + group: php-fpm mode: '0774' - name: Configure logrotate for chill diff --git a/templates/logrotate/chill b/templates/logrotate/chill index 21a6085..314ac5e 100644 --- a/templates/logrotate/chill +++ b/templates/logrotate/chill @@ -1,4 +1,5 @@ /var/log/chill/default-*.log { + su php-fpm php-fpm rotate 90 daily compress @@ -7,6 +8,7 @@ } /var/log/apt/private-*.log { + su php-fpm php-fpm rotate 180 daily compress