php: variable service name for jessie and stretch

This commit is contained in:
Jérémy Lecour 2018-06-13 09:37:55 +02:00 committed by Jérémy Lecour
parent 17d0c9c6bf
commit 767ce95b5c
4 changed files with 16 additions and 8 deletions

View file

@ -1,4 +1,10 @@
--- ---
- name: restart php5-fpm
service:
name: php5-fpm
state: restarted
- name: restart php-fpm - name: restart php-fpm
service: service:
name: php-fpm name: php-fpm

View file

@ -15,7 +15,7 @@
- { option: "log_errors", value: "On" } - { option: "log_errors", value: "On" }
- { option: "html_errors", value: "Off" } - { option: "html_errors", value: "Off" }
- { option: "allow_url_fopen", value: "Off" } - { option: "allow_url_fopen", value: "Off" }
notify: restart php-fpm notify: "restart {{ php_fpm_service_name }}"
- name: Disable PHP functions for FPM - name: Disable PHP functions for FPM
ini_file: ini_file:
@ -23,7 +23,7 @@
section: PHP section: PHP
option: disable_functions option: disable_functions
value: "exec,shell-exec,system,passthru,putenv,popen" value: "exec,shell-exec,system,passthru,putenv,popen"
notify: restart php-fpm notify: "restart {{ php_fpm_service_name }}"
- name: Custom php.ini for FPM - name: Custom php.ini for FPM
copy: copy:
@ -31,7 +31,7 @@
content: | content: |
; Put customized values here. ; Put customized values here.
force: no force: no
notify: restart php-fpm notify: "restart {{ php_fpm_service_name }}"
- name: Set default PHP FPM values - name: Set default PHP FPM values
ini_file: ini_file:
@ -50,7 +50,7 @@
- { option: "pm.status_path", value: "/fpm_status" } - { option: "pm.status_path", value: "/fpm_status" }
- { option: "request_terminate_timeout", value: "60s" } - { option: "request_terminate_timeout", value: "60s" }
- { option: "chroot", value: "/var/www/html" } - { option: "chroot", value: "/var/www/html" }
notify: restart php-fpm notify: "restart {{ php_fpm_service_name }}"
when: ansible_distribution_major_version | version_compare('9', '>=') when: ansible_distribution_major_version | version_compare('9', '>=')
- name: Custom PHP FPM values - name: Custom PHP FPM values
@ -61,7 +61,7 @@
; default_charset = "ISO-8859-1" ; default_charset = "ISO-8859-1"
mode: "0644" mode: "0644"
force: no force: no
notify: restart php-fpm notify: "restart {{ php_fpm_service_name }}"
- name: "Set custom values for PHP to enable Symfony" - name: "Set custom values for PHP to enable Symfony"
ini_file: ini_file:
@ -72,5 +72,5 @@
mode: "0644" mode: "0644"
with_items: with_items:
- { option: "date.timezone", value: "Europe/Paris" } - { option: "date.timezone", value: "Europe/Paris" }
notify: restart php-fpm notify: "restart {{ php_fpm_service_name }}"
when: php_symfony_requirements when: php_symfony_requirements

View file

@ -1,6 +1,6 @@
--- ---
- name: "Set config files paths (jessie)" - name: "Set variables (jessie)"
set_fact: set_fact:
php_cli_defaults_ini_file: /etc/php5/cli/conf.d/z-evolinux-defaults.ini php_cli_defaults_ini_file: /etc/php5/cli/conf.d/z-evolinux-defaults.ini
php_cli_custom_ini_file: /etc/php5/cli/conf.d/zzz-evolinux-custom.ini php_cli_custom_ini_file: /etc/php5/cli/conf.d/zzz-evolinux-custom.ini
@ -10,6 +10,7 @@
php_fpm_custom_ini_file: /etc/php5/fpm/conf.d/zzz-evolinux-custom.ini php_fpm_custom_ini_file: /etc/php5/fpm/conf.d/zzz-evolinux-custom.ini
php_fpm_defaults_conf_file: /etc/php5/fpm/pool.d/z-evolinux-defaults.conf php_fpm_defaults_conf_file: /etc/php5/fpm/pool.d/z-evolinux-defaults.conf
php_fpm_custom_conf_file: /etc/php5/fpm/pool.d/zzz-evolinux-custom.conf php_fpm_custom_conf_file: /etc/php5/fpm/pool.d/zzz-evolinux-custom.conf
php_fpm_service_name: php5-fpm
# Packages # Packages

View file

@ -1,6 +1,6 @@
--- ---
- name: "Set config files paths (Debian 9 or later)" - name: "Set variables (Debian 9 or later)"
set_fact: set_fact:
php_cli_defaults_ini_file: /etc/php/7.0/cli/conf.d/z-evolinux-defaults.ini php_cli_defaults_ini_file: /etc/php/7.0/cli/conf.d/z-evolinux-defaults.ini
php_cli_custom_ini_file: /etc/php/7.0/cli/conf.d/zzz-evolinux-custom.ini php_cli_custom_ini_file: /etc/php/7.0/cli/conf.d/zzz-evolinux-custom.ini
@ -10,6 +10,7 @@
php_fpm_custom_ini_file: /etc/php/7.0/fpm/conf.d/zzz-evolinux-custom.ini php_fpm_custom_ini_file: /etc/php/7.0/fpm/conf.d/zzz-evolinux-custom.ini
php_fpm_defaults_conf_file: /etc/php/7.0/fpm/pool.d/z-evolinux-defaults.conf php_fpm_defaults_conf_file: /etc/php/7.0/fpm/pool.d/z-evolinux-defaults.conf
php_fpm_custom_conf_file: /etc/php/7.0/fpm/pool.d/zzz-evolinux-custom.conf php_fpm_custom_conf_file: /etc/php/7.0/fpm/pool.d/zzz-evolinux-custom.conf
php_fpm_service_name: php5-fpm
# Packages # Packages