Skip to content

Commit

Permalink
Use the "epel" chroot for "Rocky Linux"
Browse files Browse the repository at this point in the history
PBENCH-834

Set up a map with the `ansible_distribution' value  as key and the
COPR chroot name as value. Use the map to calculate the final
component of the baseurl field in the repo file (except for CentOS 7
which is reporting "CentOS" for the ansible_distribution value but it
requires the "epel" chroot).

The map can be extended easily for other distros ( RHEL clones or
otherwise).
  • Loading branch information
ndokos authored and webbnh committed Jul 20, 2022
1 parent 0c8e182 commit 7105b25
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions agent/ansible/pbench/agent/roles/pbench_repo_install/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
---
distro: "{{ 'centos-stream' if ansible_distribution == 'CentOS' and ansible_distribution_major_version > '7'
else
'epel' if ansible_distribution == 'RedHat' or ansible_distribution == 'CentOS'
else
'fedora' if ansible_distribution == 'Fedora'
else
'' }}"
distrodir: "{{ distro }}-{{ ansible_distribution_major_version }}-$basearch"
# Map distribution name to COPR chroot
copr_chroots:
RedHat: epel
Fedora: fedora
CentOS: centos-stream
Rocky: epel

# CentOS 7 is an exception
copr_distro: "{{ 'epel' if ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'
else
copr_chroots[ansible_distribution] }}"
distrodir: "{{ copr_distro }}-{{ ansible_distribution_major_version }}-$basearch"

0 comments on commit 7105b25

Please sign in to comment.