Merge pull request #64 from wells/feature/php-8

Add support for PHP 8.0
This commit is contained in:
Jeff Geerling 2021-03-18 16:29:34 -05:00 committed by GitHub
commit 6a9b4b66ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 44 additions and 0 deletions

View File

@ -51,6 +51,14 @@ jobs:
- distro: debian10
playbook: converge.yml
# PHP 8.0.
- distro: centos8
playbook: 8.0.yml
- distro: ubuntu1804
playbook: 8.0.yml
- distro: debian10
playbook: 8.0.yml
# PHP 7.4.
- distro: centos8
playbook: 7.4.yml

24
molecule/default/8.0.yml Normal file
View File

@ -0,0 +1,24 @@
---
- name: Converge
hosts: all
become: true
vars:
php_enable_webserver: false
php_version: '8.0'
pre_tasks:
- name: Update apt cache.
apt: update_cache=true cache_valid_time=600
when: ansible_os_family == 'Debian'
roles:
- role: geerlingguy.repo-remi
when: ansible_os_family == 'RedHat'
- role: geerlingguy.php-versions
- role: geerlingguy.php
post_tasks:
- name: Confirm PHP version is correct.
shell: php -v | grep -F '{{ php_version }}'
changed_when: false

View File

@ -5,6 +5,13 @@
- "{{ role_path }}/vars/{{ ansible_os_family }}.yml"
- "{{ role_path }}/vars/{{ ansible_os_family }}-php{{ php_version }}.yml"
- name: Remove missing JSON extension for PHP 8.0 (included by default)
set_fact:
__php_packages: "{{ __php_packages | reject('search','php' + php_version + '-json') | list }}"
when:
- __php_packages is defined
- php_version is version('8.0', '>=')
- name: Define PHP variables.
set_fact: "{{ item.key }}={{ lookup('vars', item.value) }}"
when:

View File

@ -11,6 +11,10 @@
set_fact: php_enablerepo="remi,remi-php74"
when: php_version == "7.4"
- name: Enable remi repo for PHP 8.0.
set_fact: php_enablerepo="remi,remi-php80"
when: php_version == "8.0"
# See: https://github.com/ansible/ansible/issues/64852
- block:

View File

@ -42,3 +42,4 @@ php_versions_debian:
- php7.2-common
- php7.3-common
- php7.4-common
- php8.0-common