From 6eb2875e44d3b1e9c2fc3f52949852b3f88c576f Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 9 Aug 2026 11:49:52 -0500 Subject: [PATCH] Make OL get Fedora's EPEL but force it to lower priority over Oracle EPEL so that rpmfusion works, and we hopefully do not break OS patching again --- roles/ensure_repo_epel/tasks/main.yml | 24 +++++++++++++++++++ .../vars/OracleLinux-10-default.yml | 4 ++++ .../vars/OracleLinux-9-default.yml | 4 ++++ 3 files changed, 32 insertions(+) diff --git a/roles/ensure_repo_epel/tasks/main.yml b/roles/ensure_repo_epel/tasks/main.yml index 28eab8b..6633d18 100644 --- a/roles/ensure_repo_epel/tasks/main.yml +++ b/roles/ensure_repo_epel/tasks/main.yml @@ -60,5 +60,29 @@ loop_control: label: '{{ item.name }} will be {{ item.state }}' notify: [ensure_repo_epel.package_facts, ensure_repo_epel.service_facts] +- name: prioritize oracle epel repo + when: + - ansible_facts["system"] == 'Linux' + - ansible_facts["distribution"] == 'OracleLinux' + community.general.ini_file: + path: "/etc/yum.repos.d/oracle-epel-ol{{ ansible_facts['distribution_major_version'] }}.repo" + section: "ol{{ ansible_facts['distribution_major_version'] }}_developer_EPEL" + option: priority + value: '1' + no_extra_spaces: true + mode: '0644' + create: false +- name: deprioritize upstream epel repo + when: + - ansible_facts["system"] == 'Linux' + - ansible_facts["distribution"] == 'OracleLinux' + community.general.ini_file: + path: "/etc/yum.repos.d/epel.repo" + section: epel + option: priority + value: '99' + no_extra_spaces: true + mode: '0644' + create: false - name: flush handlers ansible.builtin.meta: flush_handlers diff --git a/roles/ensure_repo_epel/vars/OracleLinux-10-default.yml b/roles/ensure_repo_epel/vars/OracleLinux-10-default.yml index cfdce35..194dce1 100644 --- a/roles/ensure_repo_epel/vars/OracleLinux-10-default.yml +++ b/roles/ensure_repo_epel/vars/OracleLinux-10-default.yml @@ -9,3 +9,7 @@ package_list: name: oraclelinux-developer-release-el10 state: present url: oraclelinux-developer-release-el10 + - disable_gpg_check: 'yes' + name: epel-release + state: present + url: https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm diff --git a/roles/ensure_repo_epel/vars/OracleLinux-9-default.yml b/roles/ensure_repo_epel/vars/OracleLinux-9-default.yml index 23ed8b3..f15aa99 100644 --- a/roles/ensure_repo_epel/vars/OracleLinux-9-default.yml +++ b/roles/ensure_repo_epel/vars/OracleLinux-9-default.yml @@ -9,3 +9,7 @@ package_list: name: oraclelinux-developer-release-el9 state: present url: oraclelinux-developer-release-el9 + - disable_gpg_check: 'yes' + name: epel-release + state: present + url: https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm