diff --git a/Vagrantfile b/Vagrantfile index 4c01a9b..6ffd943 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -6,18 +6,18 @@ Vagrant.configure("2") do |config| 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-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' }} ] 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-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' }} ] diff --git a/defaults/main.yml b/defaults/main.yml index 8d56bde..07a2164 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- -php_version: '5.6' +php_version: '{{ php_default_version }}' php_install_fpm: true php_install_xdebug: false php_extra_packages: [] @@ -100,3 +100,5 @@ php_fpm_poold: pm_min_spare_servers: 10 pm_max_spare_servers: 20 +# Hack +php_default_version: 'NONE' diff --git a/tasks/main.yml b/tasks/main.yml index fb9a79e..e62b8b0 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,5 +1,8 @@ --- +- name: INCLUDE_VARS | Related to OS + include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" + - name: ASSERT | Check variables assert: that: "php_version in php_managed_versions" diff --git a/tests/test.yml b/tests/test.yml index deab3dd..4c87560 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -58,7 +58,7 @@ post_tasks: - 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 register: p failed_when: p.stdout == '' diff --git a/vars/Debian-8.yml b/vars/Debian-8.yml new file mode 100644 index 0000000..2ab5bc2 --- /dev/null +++ b/vars/Debian-8.yml @@ -0,0 +1 @@ +php_default_version: '5.6' diff --git a/vars/Debian-9.yml b/vars/Debian-9.yml new file mode 100644 index 0000000..ba02b4c --- /dev/null +++ b/vars/Debian-9.yml @@ -0,0 +1 @@ +php_default_version: '7.0'