You've already forked ansible-role-repo-epel
fix: Add pre-task for removal of epel-release 💚
This commit is contained in:
@@ -2,15 +2,33 @@
|
|||||||
- name: Converge
|
- name: Converge
|
||||||
hosts: all
|
hosts: all
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
|
- name: Check if cleanup is completed already
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: /etc/epel-cleanup
|
||||||
|
register: cleanup
|
||||||
|
|
||||||
- name: Ensure EPEL is not present
|
- name: Ensure EPEL is not present
|
||||||
yum:
|
yum:
|
||||||
name: epel-release
|
name: epel-release
|
||||||
|
disablerepo:
|
||||||
|
- epel
|
||||||
state: absent
|
state: absent
|
||||||
|
when: not cleanup.stat.exists
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Remove any traces of EPEL
|
- name: Remove any traces of EPEL
|
||||||
shell: rm -f /etc/yum.repos.d/epel*
|
shell: rm -f /etc/yum.repos.d/epel*
|
||||||
|
when: not cleanup.stat.exists
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: Create file confirming cleanup
|
||||||
|
file:
|
||||||
|
path: /etc/epel-cleanup
|
||||||
|
state: touch
|
||||||
|
when: not cleanup.stat.exists
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: "Include repo-epel"
|
- name: "Include repo-epel"
|
||||||
include_role:
|
include_role:
|
||||||
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
|
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
|
||||||
|
|||||||
@@ -2,13 +2,31 @@
|
|||||||
- name: Converge
|
- name: Converge
|
||||||
hosts: all
|
hosts: all
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
|
- name: Check if cleanup is completed already
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: /etc/epel-cleanup
|
||||||
|
register: cleanup
|
||||||
|
|
||||||
- name: Ensure EPEL is not present
|
- name: Ensure EPEL is not present
|
||||||
yum:
|
yum:
|
||||||
name: epel-release
|
name: epel-release
|
||||||
|
disablerepo:
|
||||||
|
- epel
|
||||||
state: absent
|
state: absent
|
||||||
|
when: not cleanup.stat.exists
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Remove any traces of EPEL
|
- name: Remove any traces of EPEL
|
||||||
shell: rm -f /etc/yum.repos.d/epel*
|
shell: rm -f /etc/yum.repos.d/epel*
|
||||||
|
when: not cleanup.stat.exists
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: Create file confirming cleanup
|
||||||
|
file:
|
||||||
|
path: /etc/epel-cleanup
|
||||||
|
state: touch
|
||||||
|
when: not cleanup.stat.exists
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: "Include repo-almalinux"
|
- name: "Include repo-almalinux"
|
||||||
|
|||||||
Reference in New Issue
Block a user