From 0a2c37196920a7f1dd543f19fb7dded21ca24fda Mon Sep 17 00:00:00 2001 From: Aaron Guise Date: Sun, 18 Aug 2024 11:44:24 +1200 Subject: [PATCH] =?UTF-8?q?fix:=20Add=20pre-task=20for=20removal=20of=20ep?= =?UTF-8?q?el-release=20=F0=9F=92=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- molecule/default/converge.yml | 22 ++++++++++++++++++++-- molecule/mirror-is-set/converge.yml | 18 ++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) 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"