Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Attempt to install epel-release from the internet
Browse files Browse the repository at this point in the history
after trying epel-release already in the yum repos.

Fixes: #5558
Add ansible-pulp logic to grab epel-release from the internet
https://pulp.plan.io/issues/5558
  • Loading branch information
mikedep333 committed Oct 8, 2019
1 parent 45c5464 commit 3f2a0ba
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion roles/pulp/meta/main.yml
Expand Up @@ -5,7 +5,7 @@ galaxy_info:
issue_tracker_url: https://pulp.plan.io/projects/external/issues/new
license: GPLv2
company: Red Hat
min_ansible_version: 2.2
min_ansible_version: 2.8
platforms:
- name: Fedora
versions:
Expand Down
22 changes: 19 additions & 3 deletions roles/pulp/tasks/install.yml
Expand Up @@ -8,11 +8,27 @@
# This is a lie, but necessary for Idempotence test
changed_when: False

# Break the loop once the first package name/URL in the list is found to be installed.
# The yum module (which wraps the yum command) uses rc=126 for package not
# found, or 0 for changed / already installed.
- name: Install EPEL Release
package:
name: epel-release
yum:
name: "{{ item }}"
state: present
when: ansible_distribution == 'CentOS'
# dnf/yum4 registered results not implemented yet
use_backend: yum
register: epel
when:
- (ansible_distribution == 'CentOS') or (ansible_distribution == 'RedHat')
- ({{ ansible_loop.first }}) or (epel.rc == 126)
failed_when:
- epel.rc not in [0,126]
- ({{ ansible_loop.last }}) and (epel.rc == 126)
loop:
- epel-release
- "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm"
loop_control:
extended: True

- name: Install prerequisites
package:
Expand Down

0 comments on commit 3f2a0ba

Please sign in to comment.