Yet another attempt to fix Oracle Linux vs EPEL

This commit is contained in:
2026-08-10 23:08:42 -05:00
parent 44dd3b642b
commit 0e18e3bdbb
+12 -1
View File
@@ -60,13 +60,24 @@
loop_control: loop_control:
label: '{{ item.name }} will be {{ item.state }}' label: '{{ item.name }} will be {{ item.state }}'
notify: [Ensure_Repo_Epel.Package_Facts, Ensure_Repo_Epel.Service_Facts] notify: [Ensure_Repo_Epel.Package_Facts, Ensure_Repo_Epel.Service_Facts]
- name: Read Oracle EPEL Repo File
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["distribution"] == 'OracleLinux'
ansible.builtin.slurp:
src: "/etc/yum.repos.d/oracle-epel-ol{{ ansible_facts['distribution_major_version'] }}.repo"
register: oracle_epel_repo_file
ignore_errors: true
- name: Prioritize Oracle Epel Repo - name: Prioritize Oracle Epel Repo
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ansible_facts["distribution"] == 'OracleLinux' - ansible_facts["distribution"] == 'OracleLinux'
- oracle_epel_repo_file.content is defined
- (oracle_epel_repo_file.content | b64decode | community.general.from_ini).keys() | select('search', '_EPEL') | length > 0
community.general.ini_file: community.general.ini_file:
path: "/etc/yum.repos.d/oracle-epel-ol{{ ansible_facts['distribution_major_version'] }}.repo" path: "/etc/yum.repos.d/oracle-epel-ol{{ ansible_facts['distribution_major_version'] }}.repo"
section: "ol{{ ansible_facts['distribution_major_version'] }}_developer_EPEL" section: "{{ (oracle_epel_repo_file.content | b64decode | community.general.from_ini).keys() | select('search', '_EPEL') | first }}"
option: priority option: priority
value: '1' value: '1'
no_extra_spaces: true no_extra_spaces: true