use rpm -i instead of yum install for epel7

On BaseOS CI systems, `yum install` for the epel7 rpm does not work.
Instead, use `rpm -i` which should work on any system.  We should not
need to use `yum install` here because the epel7 setup rpm does not have
additional dependencies.
In addition, the rpm download sometimes returns 403 - I think it is because
multiple tests run in parallel in BaseOS CI, resulting in too many
download attempts in too short a period of time - so introduce a retry
to mitigate the situation.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
This commit is contained in:
Rich Megginson 2022-10-28 09:55:05 -06:00 committed by Richard Megginson
parent 036f7c3c1e
commit 53208608a4

View file

@ -3,10 +3,18 @@
- block:
- name: Create EPEL {{ ansible_distribution_major_version }}
# yamllint disable-line rule:line-length
command: yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm
command: rpm -iv https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm
args:
warn: false
creates: /etc/yum.repos.d/epel.repo
register: __epel_status
# sometimes the rpm download returns a 403 - I think it is when too
# many parallel jobs attempt the download from the same controller in
# too short a period of time, so the epel server throttles additional
# downloads - use a retry here to mitigate
until: __epel_status is success
retries: 6
delay: 10
- name: Enable EPEL 7
command: yum-config-manager --enable epel