Fixes #44: Add support for CentOS / RHEL 8 AppStream modules.

This commit is contained in:
Jeff Geerling 2019-12-02 14:06:09 -06:00
parent 4eddc4bf54
commit 00463aa248
2 changed files with 24 additions and 2 deletions

View File

@ -7,13 +7,14 @@ env:
- ROLE_NAME: php-versions
matrix:
# Default PHP version (7.3).
- MOLECULE_DISTRO: centos8
- MOLECULE_DISTRO: centos7
- MOLECULE_DISTRO: ubuntu1804
- MOLECULE_DISTRO: ubuntu1604
- MOLECULE_DISTRO: debian10
# PHP 7.4.
- MOLECULE_DISTRO: centos7
- MOLECULE_DISTRO: centos8
MOLECULE_DOCKER_COMMAND: /usr/lib/systemd/systemd
MOLECULE_PLAYBOOK: playbook-7.4.yml
- MOLECULE_DISTRO: ubuntu1804
@ -22,7 +23,7 @@ env:
MOLECULE_PLAYBOOK: playbook-7.4.yml
# PHP 7.2.
- MOLECULE_DISTRO: centos7
- MOLECULE_DISTRO: centos8
MOLECULE_PLAYBOOK: playbook-7.2.yml
- MOLECULE_DISTRO: ubuntu1804
MOLECULE_PLAYBOOK: playbook-7.2.yml

View File

@ -10,3 +10,24 @@
- name: Enable remi repo for PHP 7.4.
set_fact: php_enablerepo="remi,remi-php74"
when: php_version == "7.4"
# See: https://github.com/ansible/ansible/issues/64852
- block:
- name: Ensure dnf-plugins are installed on CentOS 8+.
yum:
name: dnf-plugins-core
state: present
- name: Enable DNF module for CentOS 8+.
shell: |
dnf config-manager --set-enabled PowerTools
dnf module enable -y php:remi-{{ php_version }}
args:
warn: false
register: dnf_module_enable
changed_when: "'Nothing to do' not in dnf_module_enable.stdout"
- debug: var=dnf_module_enable
when:
- ansible_os_family == 'RedHat'
- ansible_distribution_major_version | int >= 8