From 3c3f4c09d86286e20fa58cfab49bcdc9e6868592 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Fri, 2 Nov 2018 22:43:01 +0100 Subject: [PATCH] Do not disable caching for apt when http proxies are configured This patch removes code which detected http proxies being set in environment variables, and inserted an apt configuration instructing those proxies not to perform caching. This lack of caching reduces the effectiveness of an http proxy which has caching enabled - a common technique for increasing performance of operating system installs without having to run a full mirror of upstream repositories. If a deployer is faced with a proxy server which in some way breaks upstream package repository interactions, this no-cache setting can be applied by the deployer as part of host preparation and will be duplicated into containers by the OSA tooling. Change-Id: I62293c723353ffb986db1cddc5d0da20ae0df447 --- .../remove-proxy-no-cache-9b514030c87e7d1b.yaml | 14 ++++++++++++++ tasks/configure_metal_hosts.yml | 15 --------------- 2 files changed, 14 insertions(+), 15 deletions(-) create mode 100644 releasenotes/notes/remove-proxy-no-cache-9b514030c87e7d1b.yaml diff --git a/releasenotes/notes/remove-proxy-no-cache-9b514030c87e7d1b.yaml b/releasenotes/notes/remove-proxy-no-cache-9b514030c87e7d1b.yaml new file mode 100644 index 00000000..c2ab6372 --- /dev/null +++ b/releasenotes/notes/remove-proxy-no-cache-9b514030c87e7d1b.yaml @@ -0,0 +1,14 @@ +--- +other: + - | + Code which added 'Acquire::http:No-Cache true' to the host and container + apt preferences when http proxy environment variables were set has been + removed. This setting is only required when working around issues + introduced by badly configured http proxies. In some cases proxies can + improperly cache the apt Releases and Packages files leading to package + installation errors. If a deployment is behind a badly configured proxy, + the deployer can add the necessary apt config fragment as part of host + provisioning. OSA will replicate that config into any containers that + are created. This setting can be removed from existing deployments if + required by manually deleting the file + ``/etc/apt/apt.conf.d/00apt-no-cache`` from all host and containers. diff --git a/tasks/configure_metal_hosts.yml b/tasks/configure_metal_hosts.yml index c3cc3684..d54c615e 100644 --- a/tasks/configure_metal_hosts.yml +++ b/tasks/configure_metal_hosts.yml @@ -22,21 +22,6 @@ when: - ansible_kernel | version_compare(openstack_host_required_kernel, '<') -- name: Disable cache for apt update for hosts - copy: - content: | - Acquire::http::No-Cache true; - dest: "/etc/apt/apt.conf.d/00apt-no-cache" - tags: - openstack_hosts-config - when: - - ansible_pkg_mgr == 'apt' - - > - global_environment_variables.http_proxy is defined or - global_environment_variables.HTTP_PROXY is defined or - global_environment_variables.https_proxy is defined or - global_environment_variables.HTTPS_PROXY is defined - - name: Install distro packages for bare metal nodes package: name: "{{ openstack_host_metal_distro_packages }}"