I am currently working on upgrading PHP installation on Amazon Linux 2 instance. As all the PHP 8 modules are not available in the default EPEL repo I have planned to use the REMI repository. However when I am trying to install some of the modules they are being pulled from EPEL repo. In order to resolve this I found that one of the option is to use yum priorities plugin. However there are some posts on the web stating issues with this plugin, for instance with updates. Should I invoke "yum update" before REMI repos are added? Please advice if it is ok use this plugin.
Also after adding the new repos I have invoked commands to clean metadata and update the packages. Should I do any thing apart from that? Thanks in advance.
- name: "Install EPEL"
become: true
command: "amazon-linux-extras install epel=stable"
- name: install yum priorities
become: true
command: yum install yum-plugin-priorities
- name: Add REMI repository
become: true
ansible.builtin.yum_repository:
name: remi
description: REMI YUM repo
file: external_repos
baseurl: http://rpms.remirepo.net/enterprise/7/remi/$basearch/
gpgcheck: true
gpgkey: http://rpms.remirepo.net/RPM-GPG-KEY-remi
- name: Add PHP8.0 REMI repository
become: true
ansible.builtin.yum_repository:
name: remi-php80
description: REMI PHP8.0 repo
file: php80_remi_repo
baseurl: http://rpms.remirepo.net/enterprise/7/php80/$basearch/
mirrorlist: http://cdn.remirepo.net/enterprise/7/php80/httpsmirror
priority: 1
gpgcheck: true
gpgkey: http://rpms.remirepo.net/RPM-GPG-KEY-remi
- name: Add REMI Safe repository
become: true
ansible.builtin.yum_repository:
name: remi-safe
description: REMI Safe repo
file: remi_safe_repo
baseurl: http://rpms.remirepo.net/enterprise/7/safe/$basearch/
mirrorlist: https://rpms.remirepo.net/enterprise/7/safe/httpsmirror
priority: 2
gpgcheck: true
gpgkey: http://rpms.remirepo.net/RPM-GPG-KEY-remi
- name: clean yum metadata
command: yum clean metadata
- name: yum update
become: true
command: yum -y update