]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
testnodes: Check for and remove custom apt repos 120/head
authorZack Cerza <zack@redhat.com>
Wed, 26 Aug 2015 16:19:09 +0000 (10:19 -0600)
committerZack Cerza <zack@redhat.com>
Wed, 26 Aug 2015 16:32:36 +0000 (10:32 -0600)
http://tracker.ceph.com/issues/12794

Signed-off-by: Zack Cerza <zack@redhat.com>
roles/testnode/tasks/apt/repos.yml

index 41ae7dbe8605f9dfc0e9a6ff44488befc19b6d79..e233954c9c7ff0ad797d8f2e934789abcac8dc7f 100644 (file)
@@ -1,4 +1,17 @@
 ---
+# Check for and remove custom repos.
+# http://tracker.ceph.com/issues/12794
+- name: Check for custom repos
+  shell: "ls -1 /etc/apt/sources.list.d/"
+  register: custom_repos
+  changed_when: false
+
+- name: Remove custom repos
+  file: path=/etc/apt/sources.list.d/{{ item }} state=absent
+  with_items: custom_repos.stdout_lines
+  # Ignore changes here because we will be removing repos that we end up re-adding later
+  changed_when: false
+
 - name: Set apt preferences
   template:
     dest: "/etc/apt/preferences.d/ceph.pref"
@@ -39,6 +52,8 @@
     mode: 0644
   with_items: apt_repos|list + common_apt_repos|list
   register: local_apt_repos
+  # Ignore changes here because we might have just removed these repos seconds ago
+  changed_when: false
 
 - name: Update apt cache.
   apt: