Restart the service when it fails (default).
This commit is contained in:
parent
c9b9af7968
commit
cddfb4ad27
|
|
@ -38,6 +38,7 @@ phpfpm_process_max: 256
|
||||||
phpfpm_set_event_mechanism: False
|
phpfpm_set_event_mechanism: False
|
||||||
phpfpm_event_mechanism: epoll
|
phpfpm_event_mechanism: epoll
|
||||||
|
|
||||||
|
php_service_restart_policy: 'on-failure'
|
||||||
|
|
||||||
# Pools settings
|
# Pools settings
|
||||||
phpfpm_default_pool_name: "php-fpm"
|
phpfpm_default_pool_name: "php-fpm"
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ galaxy_info:
|
||||||
license: license (EUPL)
|
license: license (EUPL)
|
||||||
min_ansible_version: 2.7
|
min_ansible_version: 2.7
|
||||||
platforms:
|
platforms:
|
||||||
- name: EL
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
- 7
|
- bionic
|
||||||
galaxy_tags:
|
galaxy_tags:
|
||||||
- php
|
- php
|
||||||
- php-fpm
|
- php-fpm
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
notify: Reload php-fpm
|
notify: Reload php-fpm
|
||||||
|
|
||||||
- name: Modify the global php settings
|
- name: Modify the global php settings
|
||||||
ini_file: dest={{ phpfpm_base_dir }}/php.ini section={{ item.section | default('PHP') }} option={{ item.option }} value={{ item.value }} backup=yes state={{ item.state | default('present') }}
|
ini_file: dest={{ phpfpm_base_dir }}/php.ini section={{ item.section | default('PHP') }} option={{ item.option }} value={{ item.value }} state={{ item.state | default('present') }}
|
||||||
with_items: '{{ php_global_settings | default([]) }}'
|
with_items: '{{ php_global_settings | default([]) }}'
|
||||||
notify: Reload php-fpm
|
notify: Reload php-fpm
|
||||||
|
|
||||||
|
|
@ -82,6 +82,12 @@
|
||||||
|
|
||||||
- name: Manage the php-fpm service
|
- name: Manage the php-fpm service
|
||||||
block:
|
block:
|
||||||
|
- name: Create the systemd override directory
|
||||||
|
file: dest=/etc/systemd/system/php{{ php_version }}-fpm.service.d state=directory owner=root group=root mode='0755'
|
||||||
|
|
||||||
|
- name: Install the unit override file
|
||||||
|
template: php-fpm.service.override.conf.j2 dest=/etc/systemd/system/php{{ php_version }}-fpm.service.d/override.conf owner=root group=root mode='0644'
|
||||||
|
|
||||||
- name: Ensure that the php-fpm service is started and enabled
|
- name: Ensure that the php-fpm service is started and enabled
|
||||||
service: name=php{{ php_version }}-fpm state=started enabled=yes
|
service: name=php{{ php_version }}-fpm state=started enabled=yes
|
||||||
when: phpfpm_service_enabled | bool
|
when: phpfpm_service_enabled | bool
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
[Service]
|
||||||
|
Restart={{ php_service_restart_policy }}
|
||||||
Loading…
Reference in New Issue