From caa8732633cae0a4d0c7db598686f58eea15a211 Mon Sep 17 00:00:00 2001 From: "Kyle L. Henderson" Date: Tue, 13 Dec 2016 08:22:16 -0600 Subject: [PATCH] Update apt after proxy config is dropped Added an apt update after the apt proxy configuration file is dropped. The error that was seen is that certain packages could not be authenticated. Updating apt after the proxy is configure solves the issue. Change-Id: Ib971231f81442b74868e692d7d47b1ce827e9c7d Closes-Bug: #1649416 --- playbooks/common-tasks/package-cache-proxy.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/playbooks/common-tasks/package-cache-proxy.yml b/playbooks/common-tasks/package-cache-proxy.yml index f8e9cabff8..3bf02026e7 100644 --- a/playbooks/common-tasks/package-cache-proxy.yml +++ b/playbooks/common-tasks/package-cache-proxy.yml @@ -24,11 +24,18 @@ copy: content: 'Acquire::http { Proxy "{{ repo_pkg_cache_url }}"; };' dest: "/etc/apt/apt.conf.d/00apt-cacher-proxy" + register: apt_proxy_dropped when: - proxy_check.status == 200 - ansible_os_family == 'Debian' - repo_pkg_cache_enabled | bool +- name: Update apt when proxy is added + apt: + update_cache: yes + when: + - apt_proxy_dropped | changed + - name: Remove apt package manager proxy file: dest: "/etc/apt/apt.conf.d/00apt-cacher-proxy"