From d85fe20e13edc959bb9ffebf8b270a167736d608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Mon, 18 Sep 2017 15:19:43 -0500 Subject: [PATCH 1/4] Issue #9: Add support for php7.2 --- tasks/main.yml | 5 ++++- tasks/setup-Debian.yml | 1 + vars/Debian-php7.2.yml | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 vars/Debian-php7.2.yml diff --git a/tasks/main.yml b/tasks/main.yml index 813b5b6..f53afd1 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,6 +1,9 @@ --- - name: Include OS-specific variables. - include_vars: "{{ ansible_os_family }}.yml" + include_vars: "{{ item }}" + with_fileglob: + - "../vars/{{ ansible_os_family }}.yml" + - "../vars/{{ ansible_os_family }}-php{{ php_version }}.yml" - name: Define PHP variables. set_fact: "{{ item.key }}={{ hostvars[inventory_hostname][item.value] }}" diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index 0197bdf..8da592d 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -49,3 +49,4 @@ - php5.6-common - php7.0-common - php7.1-common + - php7.2-common diff --git a/vars/Debian-php7.2.yml b/vars/Debian-php7.2.yml new file mode 100644 index 0000000..7c6674e --- /dev/null +++ b/vars/Debian-php7.2.yml @@ -0,0 +1,16 @@ +__php_packages: + - "php{{ php_version }}" + - "php{{ php_version }}-apcu" + - "php{{ php_version }}-cli" + - "php{{ php_version }}-common" + - "php{{ php_version }}-curl" + - "php{{ php_version }}-dev" + - "php{{ php_version }}-fpm" + - "php{{ php_version }}-gd" + - "php{{ php_version }}-imap" + - "php{{ php_version }}-json" + - "php{{ php_version }}-mbstring" + - "php{{ php_version }}-opcache" + - "php{{ php_version }}-sqlite3" + - "php{{ php_version }}-xml" + - "php{{ php_version }}-yaml" From 8321c65083530759dd87d2e2dab465192a1c573b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Mon, 18 Sep 2017 15:27:27 -0500 Subject: [PATCH 2/4] add tests for php 7.2 --- .travis.yml | 34 ++++++++++++++++++++++++++++------ tests/test-7.2.yml | 17 +++++++++++++++++ 2 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 tests/test-7.2.yml diff --git a/.travis.yml b/.travis.yml index 1943be8..0629f61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,11 +2,33 @@ services: docker env: - - distro: centos7 - - distro: centos6 - - distro: debian8 - - distro: ubuntu1604 - - distro: ubuntu1404 + global: + php_version: "7.1" + + matrix: + # Default - PHP 7.1 + - distro: centos7 + - distro: centos6 + - distro: debian8 + - distro: ubuntu1604 + - distro: ubuntu1404 + + # PHP 7.2 + - distro: centos7 + playbook: test-7.2.yml + php_version: "7.2" + - distro: centos6 + playbook: test-7.2.yml + php_version: "7.2" + - distro: debian8 + playbook: test-7.2.yml + php_version: "7.2" + - distro: ubuntu1604 + playbook: test-7.2.yml + php_version: "7.2" + - distro: ubuntu1404 + playbook: test-7.2.yml + php_version: "7.2" script: # Configure test script so we can run extra tests after playbook is run. @@ -21,7 +43,7 @@ script: - ${PWD}/tests/test.sh # Run script to test PHP version. - - 'docker exec ${container_id} env TERM=xterm php -v | grep "7.1."' + - 'docker exec ${container_id} env TERM=xterm php -v | grep "${php_version}."' notifications: webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/tests/test-7.2.yml b/tests/test-7.2.yml new file mode 100644 index 0000000..5f7070f --- /dev/null +++ b/tests/test-7.2.yml @@ -0,0 +1,17 @@ +--- +- hosts: all + + vars: + php_enable_webserver: false + php_version: "7.2" + + pre_tasks: + - name: Update apt cache. + apt: update_cache=yes cache_valid_time=600 + when: ansible_os_family == 'Debian' + + roles: + - role: geerlingguy.repo-remi + when: ansible_os_family == 'RedHat' + - role_under_test + - geerlingguy.php From 090412238ba941788520eeadd56ddddf915326ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Mon, 18 Sep 2017 15:37:58 -0500 Subject: [PATCH 3/4] Add remi repo for php 7.2 --- tasks/setup-RedHat.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasks/setup-RedHat.yml b/tasks/setup-RedHat.yml index 773e53f..7af8bf9 100644 --- a/tasks/setup-RedHat.yml +++ b/tasks/setup-RedHat.yml @@ -10,3 +10,7 @@ - name: Enable remi repo for PHP 7.1. set_fact: php_enablerepo="remi,remi-php71" when: php_version == "7.1" + +- name: Enable remi repo for PHP 7.2. + set_fact: php_enablerepo="remi,remi-php72" + when: php_version == "7.2" From 87a6cacc4134b0e9636cfd48ceca35d219538f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Mon, 18 Sep 2017 15:49:17 -0500 Subject: [PATCH 4/4] Fix travis version test by checking the literal `.` --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0629f61..ab4fc3c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,7 +43,7 @@ script: - ${PWD}/tests/test.sh # Run script to test PHP version. - - 'docker exec ${container_id} env TERM=xterm php -v | grep "${php_version}."' + - 'docker exec ${container_id} env TERM=xterm php -v | grep -F "${php_version}."' notifications: webhooks: https://galaxy.ansible.com/api/v1/notifications/