]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ansible: Manage custom repos on static libvirt slaves 783/head
authorDavid Galloway <dgallowa@redhat.com>
Fri, 7 Jul 2017 19:33:30 +0000 (15:33 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Mon, 10 Jul 2017 19:13:59 +0000 (15:13 -0400)
Probably overkill but can't hurt.

Signed-off-by: David Galloway <dgallowa@redhat.com>
ansible/examples/slave_libvirt_static.yml

index c6fecee6d34592e6efe2fb5278d4b811d8cd5f5b..903721592d0d3ed12fc6a8bdc95930c22ff96c6b 100644 (file)
       when: ansible_distribution != "Ubuntu" or
             (ansible_distribution == "Ubuntu" and ansible_distribution_major_version < 16)
 
+    - name: Check for custom repos
+      shell: "ls -1 /etc/apt/sources.list.d"
+      register: custom_repos
+
+    - name: Delete custom repos
+      file:
+        path: "/etc/apt/sources.list.d/{{ item }}"
+        state: absent
+      with_items: "{{ custom_repos.stdout_lines }}"
+      when: custom_repos|length > 0
+
+    - name: Update apt cache
+      apt:
+        update_cache: yes
+
     # vagrant doesn't have repositories, this chacra repo will be better to have
     # around and can get updates as soon as a new vagrant version is published via
     # chacractl