From c1400a35a05734219d83f2829ac13355e0aa2a00 Mon Sep 17 00:00:00 2001 From: Teodoro Cook Date: Tue, 9 Jan 2024 09:50:12 -0600 Subject: [PATCH] Fix repo management logic for redhat variants (#27) --- tasks/repo.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tasks/repo.yml b/tasks/repo.yml index 956d950..62dc921 100644 --- a/tasks/repo.yml +++ b/tasks/repo.yml @@ -57,9 +57,15 @@ - name: Manage yum repository ansible.builtin.get_url: url: "{{ docker_rpm_repo.url }}" - state: "{{ docker_repo_state }}" dest: /etc/yum.repos.d/docker.repo mode: 0644 + when: docker_repo_state != 'absent' + + - name: Remove yum repository + ansible.builtin.file: + dest: /etc/yum.repos.d/docker.repo + state: "{{ docker_repo_state }}" + mode: 0644 - name: Flush handlers ansible.builtin.meta: flush_handlers