Be specific with Oracle Linux and EPEL RPMs

This commit is contained in:
Jason Rothstein 2020-11-29 21:34:09 -06:00
parent 09f6c8352b
commit c72d7ff9d8
2 changed files with 26 additions and 2 deletions

View File

@ -30,7 +30,7 @@ Including an example of how to use your role (for instance, with variables passe
License
-------
LGPL >= 3
LGPL-3.0-or-later
Author Information
------------------

View File

@ -4,7 +4,7 @@
when:
- ansible_system == 'Linux'
- packages is not defined
package_facts:
ansible.builtin.package_facts:
- name: 'ensure packages'
when:
- ansible_system == 'Linux'
@ -28,6 +28,30 @@
notify:
- 'ensure_repo_epel.package_facts'
- 'ensure_repo_epel.service_facts'
- name: 'ensure packages'
when:
- ansible_system == 'Linux'
- ansible_distribution == 'Oracle'
- ansible_distribution_major_version|int == 7
- packages['epel-release'] is not defined
ansible.builtin.package:
name: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm'
state: 'installed'
notify:
- 'ensure_repo_epel.package_facts'
- 'ensure_repo_epel.service_facts'
- name: 'ensure packages'
when:
- ansible_system == 'Linux'
- ansible_distribution == 'Oracle'
- ansible_distribution_major_version|int == 8
- packages['epel-release'] is not defined
ansible.builtin.package:
name: 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm'
state: 'installed'
notify:
- 'ensure_repo_epel.package_facts'
- 'ensure_repo_epel.service_facts'
- name: 'ensure packages'
when:
- ansible_system == 'Linux'