roles/php-fpm: Support php-fpm 7.2 on Ubuntu 18.04
Adds a separate handler for the php-fpm7.2 service and cleans up the pool config file to remove some content that causes Jinja2 to choke.
This commit is contained in:
parent
975a4d3f28
commit
9675542f7d
@ -3,4 +3,8 @@
|
|||||||
- name: reload php7.0-fpm
|
- name: reload php7.0-fpm
|
||||||
systemd: name=php7.0-fpm state=reloaded
|
systemd: name=php7.0-fpm state=reloaded
|
||||||
|
|
||||||
|
# For Ubuntu 18.04
|
||||||
|
- name: reload php7.2-fpm
|
||||||
|
systemd: name=php7.2-fpm state=reloaded
|
||||||
|
|
||||||
# vim: set ts=2 sw=2:
|
# vim: set ts=2 sw=2:
|
||||||
|
34
roles/php-fpm/tasks/Ubuntu_18.04.yml
Normal file
34
roles/php-fpm/tasks/Ubuntu_18.04.yml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
---
|
||||||
|
- name: Install php-fpm and deps
|
||||||
|
apt: name={{ item }} state=present update_cache=yes
|
||||||
|
with_items:
|
||||||
|
- php-fpm
|
||||||
|
# for WordPress
|
||||||
|
- php-mysql
|
||||||
|
- php-gd
|
||||||
|
- php-curl
|
||||||
|
# for Piwik
|
||||||
|
- php-mbstring
|
||||||
|
- php-xml
|
||||||
|
tags: php-fpm, packages
|
||||||
|
|
||||||
|
# only copy php-fpm config for vhosts that need WordPress or PHP
|
||||||
|
- name: Copy php-fpm pool config
|
||||||
|
template: src=php7.2-pool.conf.j2 dest=/etc/php/7.2/fpm/pool.d/{{ item.domain_name }}.conf owner=root group=root mode=0644
|
||||||
|
with_items: "{{ nginx_vhosts }}"
|
||||||
|
when: (item.has_wordpress is defined and item.has_wordpress == True) or (item.needs_php is defined and item.needs_php == True)
|
||||||
|
notify: reload php7.2-fpm
|
||||||
|
tags: php-fpm
|
||||||
|
|
||||||
|
- name: Remove default www pool
|
||||||
|
file: path=/etc/php/7.2/fpm/pool.d/www.conf state=absent
|
||||||
|
notify: reload php7.2-fpm
|
||||||
|
tags: php-fpm
|
||||||
|
|
||||||
|
# re-configure php.ini
|
||||||
|
- name: Update php.ini
|
||||||
|
template: src=php7.2-php.ini.j2 dest=/etc/php/7.2/fpm/php.ini owner=root group=root mode=0644
|
||||||
|
notify: reload php7.2-fpm
|
||||||
|
tags: php-fpm
|
||||||
|
|
||||||
|
# vim: set ts=2 sw=2:
|
@ -7,4 +7,9 @@
|
|||||||
when: ansible_distribution == 'Ubuntu' or (ansible_distribution == 'Debian' and ansible_distribution_major_version is version_compare('9', '=='))
|
when: ansible_distribution == 'Ubuntu' or (ansible_distribution == 'Debian' and ansible_distribution_major_version is version_compare('9', '=='))
|
||||||
tags: php-fpm
|
tags: php-fpm
|
||||||
|
|
||||||
|
- name: Configure php-fpm on Ubuntu 18.04
|
||||||
|
import_tasks: Ubuntu_18.04.yml
|
||||||
|
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version | version_compare('18.04', '==')
|
||||||
|
tags: php-fpm
|
||||||
|
|
||||||
# vim: set ts=2 sw=2:
|
# vim: set ts=2 sw=2:
|
||||||
|
@ -301,13 +301,9 @@ pm.max_spare_servers = 3
|
|||||||
; %t: server time the request was received
|
; %t: server time the request was received
|
||||||
; it can accept a strftime(3) format:
|
; it can accept a strftime(3) format:
|
||||||
; %d/%b/%Y:%H:%M:%S %z (default)
|
; %d/%b/%Y:%H:%M:%S %z (default)
|
||||||
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
|
|
||||||
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
|
|
||||||
; %T: time the log has been written (the request has finished)
|
; %T: time the log has been written (the request has finished)
|
||||||
; it can accept a strftime(3) format:
|
; it can accept a strftime(3) format:
|
||||||
; %d/%b/%Y:%H:%M:%S %z (default)
|
; %d/%b/%Y:%H:%M:%S %z (default)
|
||||||
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
|
|
||||||
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
|
|
||||||
; %u: remote user
|
; %u: remote user
|
||||||
;
|
;
|
||||||
; Default: "%R - %u %t \"%m %r\" %s"
|
; Default: "%R - %u %t \"%m %r\" %s"
|
||||||
|
Loading…
Reference in New Issue
Block a user