2017-05-19 19:36:36 +02:00
|
|
|
---
|
2021-03-18 22:33:55 +01:00
|
|
|
# TODO: PHP 7.2 support will be removed soon. This is only being left in here as
|
|
|
|
# a convenience for legacy PHP 7.2 users.
|
2017-09-18 22:37:58 +02:00
|
|
|
- name: Enable remi repo for PHP 7.2.
|
|
|
|
set_fact: php_enablerepo="remi,remi-php72"
|
|
|
|
when: php_version == "7.2"
|
2018-10-15 22:54:45 +02:00
|
|
|
|
|
|
|
- name: Enable remi repo for PHP 7.3.
|
|
|
|
set_fact: php_enablerepo="remi,remi-php73"
|
|
|
|
when: php_version == "7.3"
|
2019-12-02 19:32:59 +01:00
|
|
|
|
|
|
|
- name: Enable remi repo for PHP 7.4.
|
|
|
|
set_fact: php_enablerepo="remi,remi-php74"
|
|
|
|
when: php_version == "7.4"
|
2019-12-02 21:06:09 +01:00
|
|
|
|
2021-03-18 18:17:42 +01:00
|
|
|
- name: Enable remi repo for PHP 8.0.
|
|
|
|
set_fact: php_enablerepo="remi,remi-php80"
|
|
|
|
when: php_version == "8.0"
|
2021-11-27 15:08:33 +01:00
|
|
|
|
|
|
|
- name: Enable remi repo for PHP 8.1.
|
|
|
|
set_fact: php_enablerepo="remi,remi-php81"
|
|
|
|
when: php_version == "8.1"
|
2021-03-18 18:17:42 +01:00
|
|
|
|
2019-12-02 21:06:09 +01:00
|
|
|
# See: https://github.com/ansible/ansible/issues/64852
|
|
|
|
- block:
|
2019-12-03 21:18:30 +01:00
|
|
|
|
2019-12-02 21:06:09 +01:00
|
|
|
- name: Ensure dnf-plugins are installed on CentOS 8+.
|
|
|
|
yum:
|
|
|
|
name: dnf-plugins-core
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Enable DNF module for CentOS 8+.
|
|
|
|
shell: |
|
2021-02-16 21:35:34 +01:00
|
|
|
dnf config-manager --set-enabled powertools
|
2019-12-02 21:06:09 +01:00
|
|
|
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"
|
2019-12-03 21:18:30 +01:00
|
|
|
|
|
|
|
when:
|
|
|
|
- ansible_os_family == 'RedHat'
|
|
|
|
- ansible_distribution_major_version | int >= 8
|