diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index d6601a6..7ac6779 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -2,15 +2,33 @@ - name: Converge hosts: all pre_tasks: + - name: Check if cleanup is completed already + ansible.builtin.stat: + path: /etc/epel-cleanup + register: cleanup + - name: Ensure EPEL is not present yum: name: epel-release + disablerepo: + - epel state: absent + when: not cleanup.stat.exists + changed_when: false - name: Remove any traces of 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: - name: "Include repo-epel" include_role: - name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}" \ No newline at end of file + name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}" diff --git a/molecule/mirror-is-set/converge.yml b/molecule/mirror-is-set/converge.yml index 17405e9..9b71033 100644 --- a/molecule/mirror-is-set/converge.yml +++ b/molecule/mirror-is-set/converge.yml @@ -2,13 +2,31 @@ - name: Converge hosts: all pre_tasks: + - name: Check if cleanup is completed already + ansible.builtin.stat: + path: /etc/epel-cleanup + register: cleanup + - name: Ensure EPEL is not present yum: name: epel-release + disablerepo: + - epel state: absent + when: not cleanup.stat.exists + changed_when: false - name: Remove any traces of 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: - name: "Include repo-almalinux"