mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 18:35:13 +00:00
EPEL yum repository configuration for tests
In tests/tasks/enable_epel.yml, if /etc/yum.repos.d/epel.repo exists and it is not enabled, it's left disabled. Without the epel enabled, it fails to install necessary modules such as python-mock, which makes tests_unit.yml and tests_wireless_nm.yml fail. This patch adds a task calling ini_file to ensure the repo is always enabled. See also bz1980439 Signed-off-by: Noriko Hosoi <nhosoi@redhat.com>
This commit is contained in:
parent
245ff58e25
commit
1f25fbb4fc
1 changed files with 22 additions and 6 deletions
|
|
@ -1,11 +1,27 @@
|
|||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
---
|
||||
- name: Enable 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
|
||||
args:
|
||||
warn: false
|
||||
creates: /etc/yum.repos.d/epel.repo
|
||||
- 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
|
||||
args:
|
||||
warn: false
|
||||
creates: /etc/yum.repos.d/epel.repo
|
||||
|
||||
- name: Retrieve EPEL {{ ansible_distribution_major_version }} file stats
|
||||
stat:
|
||||
path: /etc/yum.repos.d/epel.repo
|
||||
register: _result
|
||||
|
||||
- name: Enable EPEL {{ ansible_distribution_major_version }}
|
||||
ini_file:
|
||||
path: /etc/yum.repos.d/epel.repo
|
||||
section: epel
|
||||
mode: "{{ _result.stat.mode }}"
|
||||
owner: "{{ _result.stat.pw_name }}"
|
||||
group: "{{ _result.stat.gr_name }}"
|
||||
option: enabled
|
||||
value: "1"
|
||||
when:
|
||||
- ansible_distribution in ['RedHat', 'CentOS']
|
||||
- ansible_distribution_major_version in ['7', '8']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue