handle php logrotate

This commit is contained in:
Ludovic Cartier
2025-09-24 15:37:04 +02:00
parent e9dae1dd0b
commit 140610f8ee
4 changed files with 47 additions and 0 deletions

View File

@@ -33,3 +33,19 @@
- php_remove_default_pool | bool
notify:
- restart php-fpm services
- name: php | check if logrotate is installed
package_facts:
manager: "auto"
- name: php | create logrotate configuration for php-fpm logs
template:
src: php-fpm.logrotate.j2
dest: "/etc/logrotate.d/php-fpm"
owner: root
group: root
mode: '0644'
when:
- php_logrotate_enabled | default(true) | bool
- "'logrotate' in ansible_facts.packages"
- php_pools is defined and php_pools | length > 0