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
This commit is contained in:
Mohammed Naser 2018-11-02 22:43:01 +01:00 committed by Jesse Pretorius (odyssey4me)
parent c694cdf75f
commit 3c3f4c09d8
2 changed files with 14 additions and 15 deletions

View File

@ -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.

View File

@ -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 }}"