]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
downstream-setup: add a task to remove a yum repo from /etc/yum.repos.d 10/head
authorAndrew Schoen <aschoen@redhat.com>
Mon, 18 May 2015 21:23:31 +0000 (16:23 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Mon, 18 May 2015 21:27:31 +0000 (16:27 -0500)
Using the remove_yum_repos var give a list of yum repos names to remove
from /etc/yum.repos.d. This gives a way for us to clean up yum repos
that we add with this role.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
roles/downstream-setup/defaults/main.yml
roles/downstream-setup/tasks/main.yml
roles/downstream-setup/tasks/remove_yum_repos.yml [new file with mode: 0644]

index f991bf6be227122a81ff5b0c181f16821e1280d4..15c78c18aafd0d290980479d76a86af21c4efddb 100644 (file)
@@ -9,3 +9,7 @@
 #       name: "epel"
 #
 yum_repos: []
+
+# a list of repo names as strings to delete from /etc/yum.repos.d
+# the name should not include the .repo extension
+remove_yum_repos: []
index 7b78b655759d5660fce370cbe539d564390c4214..2c53da92484051469fe76e4d9b0e5a7cd4ea2f5f 100644 (file)
@@ -1,4 +1,10 @@
 ---
 - include: yum_repos.yml
+  when: yum_repos|length > 0
   tags:
     - yum-repos
+
+- include: remove_yum_repos.yml
+  when: remove_yum_repos|length > 0
+  tags:
+    - delete-yum-repos
diff --git a/roles/downstream-setup/tasks/remove_yum_repos.yml b/roles/downstream-setup/tasks/remove_yum_repos.yml
new file mode 100644 (file)
index 0000000..b7e0594
--- /dev/null
@@ -0,0 +1,6 @@
+---
+- name: Delete yum repos from /etc/yum.repos.d
+  file:
+    path: "/etc/yum.repos.d/{{ item }}.repo"
+    state: absent
+  with_items: remove_yum_repos