Yet another attempt to fix Oracle Linux vs EPEL
This commit is contained in:
@@ -60,13 +60,24 @@
|
||||
loop_control:
|
||||
label: '{{ item.name }} will be {{ item.state }}'
|
||||
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
|
||||
when:
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- 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:
|
||||
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
|
||||
value: '1'
|
||||
no_extra_spaces: true
|
||||
|
||||
Reference in New Issue
Block a user