New PHP management

- New versions (7.x)
- PHP upstream name
- Sites can use : default PHP version, select first one by PHP version,
  select by upstream name
- Add PHP filter plugin
This commit is contained in:
Emilien Mantel
2017-10-26 10:59:24 +02:00
parent 70283ddcc6
commit 463ce45105
15 changed files with 122 additions and 120 deletions

View File

@@ -2,10 +2,6 @@
- hosts: all
pre_tasks:
- debug: var=dotdeb
- debug: var=nginx_php56
- debug: var=nginx_php70
- debug: var=nginx_backports
- name: INCLUDE | Pre_tasks related to OS version
include: "includes/pre_{{ ansible_distribution }}.yml"
- name: FILE | Create an internal SSL dir
@@ -171,7 +167,7 @@
- '/b'
- '/c'
- name: 'test-php.local'
php_version: "{{ '7.0' if nginx_php70 else '5.6' }}"
php_version: "{{ nginx_php.1.version if nginx_php.1 is defined else nginx_php.0.version }}"
upstream_params:
- 'fastcgi_param FOO bar;'
redirect_from:
@@ -296,21 +292,15 @@
# --------------------------------
# PHP
# --------------------------------
- name: -- VERIFY PHP5 SITES (implicit default) --
command: "curl -H 'Host: {{ item }}' http://127.0.0.1/"
- name: -- VERIFY PHP SITES --
command: "curl -H 'Host: {{ item.name }}' http://127.0.0.1/"
register: p
with_items: "{{ nginx_sites }}"
when: >
item.template is defined and
(item.template == '_php' or item.template == '_php_index')
changed_when: false
failed_when: p.stdout.find('PHP Version 5') == -1
with_items: ['test-php-index.local']
when: nginx_php56
- name: -- VERIFY PHP7 SITES --
command: "curl -H 'Host: {{ item }}' http://127.0.0.1/"
register: p
changed_when: false
failed_when: p.stdout.find('PHP Version 7') == -1
with_items: ['test-php.local']
when: nginx_php70
failed_when: p.stdout.find('PHP Version ' + item.php_version if 'php_version' in item else nginx_php.0.version) == -1
# --------------------------------
# Basic Auth
@@ -377,7 +367,7 @@
register: nagios_cgi
failed_when: nagios_cgi.stdout.find('Nagios Event Summary') == -1
when: ansible_distribution_major_version | version_compare('9', 'lt')
when: ansible_distribution_major_version | version_compare('9', 'lt')
# --------------------------------
# Owncloud