Use systemd to "monitor" and restart the service

This commit is contained in:
phil 2023-11-01 08:13:57 +01:00
parent 6c6227919d
commit d60c4d99b9
5 changed files with 13 additions and 25 deletions

View file

@ -18,7 +18,3 @@
- name: User tasks
ansible.builtin.import_tasks: user.yml
tags: never, user
- name: Monitoring tasks
ansible.builtin.import_tasks: monitoring.yml
tags: monitoring

View file

@ -1,8 +0,0 @@
---
- name: "Monitoring | Enable Monit monitoring"
ansible.builtin.template:
src: monit.j2
dest: /etc/monit/conf-enabled/phpfpm
mode: "0644"
when: '"monit" in ansible_facts.packages'
notify: reload monit

View file

@ -37,3 +37,12 @@
path: /etc/systemd/system/php-fpm@.service.d
state: directory
mode: "0755"
- name: "PHP | Copy systemd override configuration"
ansible.builtin.copy:
src: systemd/override.conf
dest: /etc/systemd/system/php-fpm@.service.d/override.conf
mode: "0644"
notify:
- stop php-fpm-service
- start php-fpm-socket