Skip to content

Commit cebc719

Browse files
committed
disable all dnf repos at end of build
1 parent b160d04 commit cebc719

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed
Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
- name: Disable Pulp repos
2+
- name: Remove password and disable Pulp repos
33
ansible.builtin.yum_repository:
44
file: "{{ item.file }}"
55
name: "{{ item.name }}"
@@ -8,11 +8,25 @@
88
enabled: false
99
loop: "{{ dnf_repos_repolist }}"
1010

11-
- name: Disable EPEL repo
11+
- name: Remove password and disable EPEL repo
1212
ansible.builtin.yum_repository:
1313
name: epel
1414
file: epel
1515
description: "{{ dnf_repos_epel_description }}"
1616
baseurl: "{{ dnf_repos_epel_baseurl }}"
1717
gpgcheck: false
1818
enabled: false
19+
20+
- name: Get all repo files
21+
ansible.builtin.find:
22+
paths: /etc/yum.repos.d
23+
patterns: '*.repo'
24+
register: _dnf_repo_files
25+
26+
- name: Disable every repo
27+
ansible.builtin.replace:
28+
path: "{{ item.path }}"
29+
regexp: '^enabled\ ?=\ ?1'
30+
replace: 'enabled=0'
31+
backup: yes
32+
loop: "{{ _dnf_repo_files.files }}"

0 commit comments

Comments
 (0)