Skip to content

Commit

Permalink
[yum_repository tests] account for EOL'd EPEL
Browse files Browse the repository at this point in the history
Change:
- Let the tests continue to run on EOL'd CentOS 6 and EOL'd EPEL 6.

Signed-off-by: Rick Elrod <rick@elrod.me>
  • Loading branch information
relrod authored and mattclay committed Dec 2, 2020
1 parent 8192ed4 commit 7666b7f
Showing 1 changed file with 18 additions and 6 deletions.
Expand Up @@ -40,11 +40,21 @@
- sl_result.failed
- "sl_result.msg==\"No package matching 'sl' found available, installed or updated\""

- name: Determine EPEL baseurl (archived versions)
set_fact:
epel_baseurl: https://archives.fedoraproject.org/pub/archive/epel/{{ ansible_distribution_major_version }}/$basearch
when: ansible_distribution_major_version|int == 6

- name: Determine EPEL baseurl (live versions)
set_fact:
epel_baseurl: https://download.fedoraproject.org/pub/epel/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/
when: ansible_distribution_major_version|int > 6

- name: re-add epel
yum_repository:
name: epel
description: EPEL yum repo
baseurl: https://download.fedoraproject.org/pub/epel/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/
baseurl: "{{ epel_baseurl }}"
state: present
register: epel_add

Expand Down Expand Up @@ -84,7 +94,7 @@
- name: change configuration of epel repo
yum_repository:
name: epel
baseurl: https://download.fedoraproject.org/pub/epel/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/
baseurl: "{{ epel_baseurl }}"
description: New description
async: no
enablegroups: no
Expand All @@ -110,7 +120,7 @@
- name: check new config doesn't change (Idempotant)
yum_repository:
name: epel
baseurl: https://download.fedoraproject.org/pub/epel/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/
baseurl: "{{ epel_baseurl }}"
description: New description
async: no
enablegroups: no
Expand All @@ -127,14 +137,14 @@
yum_repository:
name: epel
description: EPEL yum repo
baseurl: https://download.fedoraproject.org/pub/epel/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/
baseurl: "{{ epel_baseurl }}"
state: present

- name: re-enable the epel repo (Idempotant)
yum_repository:
name: epel
description: EPEL yum repo
baseurl: https://download.fedoraproject.org/pub/epel/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/
baseurl: "{{ epel_baseurl }}"
state: present
register: epel_add

Expand All @@ -147,6 +157,8 @@
name: listtest
description: Testing list feature
baseurl:
# We don't install anything right after this test, so we don't have to
# account for archived epel versions ({{ epel_baseurl }}) here.
- https://download.fedoraproject.org/pub/epel/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/
- https://download2.fedoraproject.org/pub/epel/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/
gpgkey:
Expand Down Expand Up @@ -186,7 +198,7 @@
yum_repository:
name: epel
description: EPEL yum repo
baseurl: https://download.fedoraproject.org/pub/epel/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/
baseurl: "{{ epel_baseurl }}"
state: present
gpgcheck: no

Expand Down

0 comments on commit 7666b7f

Please sign in to comment.