Support many php versions (php7) + drop wheezy support

This commit is contained in:
Emilien Mantel
2016-08-09 16:02:09 +02:00
parent af3930a58a
commit e4b5bb2a32
15 changed files with 83 additions and 18 deletions

View File

@@ -3,10 +3,18 @@
- name: APT_REPOSITORY | Install backports
apt_repository: repo='deb http://httpredir.debian.org/debian {{ ansible_distribution_release }}-backports main' state=present
- block:
- name: APT | Install DotDeb key
apt_key: url='http://www.dotdeb.org/dotdeb.gpg' state=present
- name: APT_REPOSITORY | Install dotdeb (PHP 7)
apt_repository: repo='deb http://packages.dotdeb.org {{ ansible_distribution_release }} all' state=present
when: ansible_distribution_release == 'jessie'
- name: APT | Install needed packages
apt: pkg={{ item }} update_cache=yes cache_valid_time=3600 state=present
with_items:
- php5-fpm
- php7.0-fpm
- curl
- fcgiwrap
@@ -19,4 +27,5 @@
register: sf
with_items:
- php5-fpm
- php7.0-fpm
- fcgiwrap

View File

@@ -4,7 +4,8 @@
set_fact:
nginx_pkgng_package: 'nginx-devel'
nginx_user: 'www'
nginx_php_sockets:
nginx_php7: false
nginx_php5_sockets:
- host: '127.0.0.1'
port: 9000

View File

@@ -16,7 +16,8 @@
# Role vars
nginx_worker_processes: 1 # Ansible+FreeBSD can't detect CPU number
nginx_backports: true
nginx_php: true
nginx_php5: true
nginx_php7: true
nginx_upstreams:
- name: 'test'
servers:
@@ -145,6 +146,7 @@
'/':
- 'alias /var/tmp;'
- name: 'test-php.local'
php_version: 7
upstream_params:
- 'fastcgi_param FOO bar;'
redirect_from:
@@ -240,6 +242,20 @@
failed_when: p.stdout.find('PHP Version') == -1
with_items: ['test-php.local', 'test-php-index.local']
- name: -- VERIFY PHP5 VHOSTS (implicit default) --
command: "curl -H 'Host: {{ item }}' http://127.0.0.1/"
register: p
changed_when: false
failed_when: p.stdout.find('PHP Version 5') == -1
with_items: ['test-php-index.local']
- name: -- VERIFY PHP7 VHOSTS --
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']
# --------------------------------
# Basic Auth
# --------------------------------