Load default PHP version per OS release

freebsd
Emilien Mantel 2017-06-13 11:51:51 +02:00
parent 8758a9b7dc
commit f38aa400b3
6 changed files with 13 additions and 6 deletions

8
Vagrantfile vendored
View File

@ -6,18 +6,18 @@
Vagrant.configure("2") do |config| Vagrant.configure("2") do |config|
vms_debian = [ vms_debian = [
{ :name => "debian-jessie-php56", :box => "debian/jessie64", :vars => { "php_version": '5.6' }}, { :name => "debian-jessie-php56", :box => "debian/jessie64", :vars => { }},
{ :name => "debian-jessie-php70", :box => "debian/jessie64", :vars => { "php_version": '7.0' }}, { :name => "debian-jessie-php70", :box => "debian/jessie64", :vars => { "php_version": '7.0' }},
{ :name => "debian-jessie-php71", :box => "debian/jessie64", :vars => { "php_version": '7.1' }}, { :name => "debian-jessie-php71", :box => "debian/jessie64", :vars => { "php_version": '7.1' }},
{ :name => "debian-stretch-php70", :box => "debian/stretch64", :vars => { "php_version": '7.0' }}, { :name => "debian-stretch-php70", :box => "debian/stretch64", :vars => { }},
{ :name => "debian-stretch-php71", :box => "debian/stretch64", :vars => { "php_version": '7.1' }} { :name => "debian-stretch-php71", :box => "debian/stretch64", :vars => { "php_version": '7.1' }}
] ]
conts = [ conts = [
{ :name => "docker-debian-jessie-php56", :docker => "hanxhx/vagrant-ansible:debian8", :vars => { "php_version": '5.6' }}, { :name => "docker-debian-jessie-php56", :docker => "hanxhx/vagrant-ansible:debian8", :vars => { }},
{ :name => "docker-debian-jessie-php70", :docker => "hanxhx/vagrant-ansible:debian8", :vars => { "php_version": '7.0' }}, { :name => "docker-debian-jessie-php70", :docker => "hanxhx/vagrant-ansible:debian8", :vars => { "php_version": '7.0' }},
{ :name => "docker-debian-jessie-php71", :docker => "hanxhx/vagrant-ansible:debian8", :vars => { "php_version": '7.1' }}, { :name => "docker-debian-jessie-php71", :docker => "hanxhx/vagrant-ansible:debian8", :vars => { "php_version": '7.1' }},
{ :name => "docker-debian-stretch-php70", :docker => "hanxhx/vagrant-ansible:debian9", :vars => { "php_version": '7.0' }}, { :name => "docker-debian-stretch-php70", :docker => "hanxhx/vagrant-ansible:debian9", :vars => { }},
{ :name => "docker-debian-stretch-php71", :docker => "hanxhx/vagrant-ansible:debian9", :vars => { "php_version": '7.1' }} { :name => "docker-debian-stretch-php71", :docker => "hanxhx/vagrant-ansible:debian9", :vars => { "php_version": '7.1' }}
] ]

View File

@ -1,6 +1,6 @@
--- ---
php_version: '5.6' php_version: '{{ php_default_version }}'
php_install_fpm: true php_install_fpm: true
php_install_xdebug: false php_install_xdebug: false
php_extra_packages: [] php_extra_packages: []
@ -100,3 +100,5 @@ php_fpm_poold:
pm_min_spare_servers: 10 pm_min_spare_servers: 10
pm_max_spare_servers: 20 pm_max_spare_servers: 20
# Hack
php_default_version: 'NONE'

View File

@ -1,5 +1,8 @@
--- ---
- name: INCLUDE_VARS | Related to OS
include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
- name: ASSERT | Check variables - name: ASSERT | Check variables
assert: assert:
that: "php_version in php_managed_versions" that: "php_version in php_managed_versions"

View File

@ -58,7 +58,7 @@
post_tasks: post_tasks:
- name: SHELL | Test php-cli - name: SHELL | Test php-cli
shell: php -i | grep '^PHP Version' | head -n 1 shell: php -i | grep '^PHP Version => {{ php_version }}' | head -n 1
changed_when: false changed_when: false
register: p register: p
failed_when: p.stdout == '' failed_when: p.stdout == ''

View File

@ -0,0 +1 @@
php_default_version: '5.6'

View File

@ -0,0 +1 @@
php_default_version: '7.0'