Add php-fpm user and group for log file ownership
This commit introduces the php-fpm user and group, assigning ownership of relevant log files to ensure proper permissions. Updates were also made to the logrotate configuration to include the `su` directive for php-fpm. These changes improve compatibility and address log management requirements.
This commit is contained in:
parent
edf09e16c2
commit
41531016aa
@ -28,13 +28,26 @@
|
|||||||
username: "{{ docker_hub_username }}"
|
username: "{{ docker_hub_username }}"
|
||||||
password: "{{ docker_hub_token }}"
|
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
|
- name: Create log directory
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /var/log/chill
|
path: /var/log/chill
|
||||||
state: directory
|
state: directory
|
||||||
owner: 33
|
owner: php-fpm
|
||||||
group: 33
|
group: php-fpm
|
||||||
mode: '0774'
|
mode: '0774'
|
||||||
|
|
||||||
- name: Configure logrotate for chill
|
- name: Configure logrotate for chill
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/var/log/chill/default-*.log {
|
/var/log/chill/default-*.log {
|
||||||
|
su php-fpm php-fpm
|
||||||
rotate 90
|
rotate 90
|
||||||
daily
|
daily
|
||||||
compress
|
compress
|
||||||
@ -7,6 +8,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/var/log/apt/private-*.log {
|
/var/log/apt/private-*.log {
|
||||||
|
su php-fpm php-fpm
|
||||||
rotate 180
|
rotate 180
|
||||||
daily
|
daily
|
||||||
compress
|
compress
|
||||||
|
Loading…
Reference in New Issue
Block a user