From fa8833819bb8deaf3446e1b96456fdc7221ff724 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Fri, 7 Jul 2017 15:33:30 -0400 Subject: [PATCH] ansible: Manage custom repos on static libvirt slaves Probably overkill but can't hurt. Signed-off-by: David Galloway --- ansible/examples/slave_libvirt_static.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ansible/examples/slave_libvirt_static.yml b/ansible/examples/slave_libvirt_static.yml index c6fecee6..90372159 100644 --- a/ansible/examples/slave_libvirt_static.yml +++ b/ansible/examples/slave_libvirt_static.yml @@ -27,6 +27,21 @@ 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 -- 2.39.5