Remove apt-cacher-ng

The repo container's package cache causes quite a bit of confusion
given that it's a 'hidden' feature which catches deployers off-guard
when they already have their own cache configured. This is really
the kind of service which people should manage outside of OSA. It
also makes no sense if the deployer is using their own local mirror
which is a fairly common practise. Adding to that, it seems that it
is broken in bionic, causing massive delays in package installs.
Finally, it also adds to quite a bit of complexity due to the fact
that it's in a container - so in the playbooks prior to the container's
existence we have to detect whether it's there and add/remove the config
accordingly.

Let's just remove it and let deployers managing their own caching
infrastructure if they want it.

Depends-On: https://review.openstack.org/608880
Change-Id: Ia0fb41266a6d62073b02c8ad6fa97b8b7d408a67
(cherry picked from commit 43a5c874ef)
This commit is contained in:
Jesse Pretorius 2018-10-08 11:53:21 +01:00
parent cf2b7bab51
commit aa100d4ecd
5 changed files with 15 additions and 63 deletions

View File

@ -153,7 +153,7 @@
- name: repo_server
scm: git
src: https://git.openstack.org/openstack/openstack-ansible-repo_server
version: b02b390e974e82a809f4b547b1ee8698a5aa691f
version: 9c18f6bda58ee3882c7daa647755a432c0693052
- name: rsyslog_client
scm: git
src: https://git.openstack.org/openstack/openstack-ansible-rsyslog_client

View File

@ -56,9 +56,6 @@ rsyslog_server_enabled: "{{ ansible_pkg_mgr == 'zypper' }}"
# URL for the frozen internal openstack repo.
repo_server_port: 8181
repo_pkg_cache_enabled: true
repo_pkg_cache_port: 3142
repo_pkg_cache_url: "http://{{ internal_lb_vip_address }}:{{ repo_pkg_cache_port }}"
## Default installation method for OpenStack services
install_method: "source"

View File

@ -71,17 +71,6 @@ haproxy_default_services:
haproxy_backend_options:
- "httpchk HEAD / HTTP/1.0\\r\\nUser-agent:\\ osa-haproxy-healthcheck"
haproxy_service_enabled: "{{ groups['repo_all'] is defined and groups['repo_all'] | length > 0 }}"
- service:
haproxy_service_name: repo_cache
haproxy_backend_nodes: "{{ (groups['repo_all'] | default([]))[:1] }}" # list expected
haproxy_backup_nodes: "{{ (groups['repo_all'] | default([]))[1:] }}"
haproxy_bind: "{{ [internal_lb_vip_address] }}"
haproxy_port: "{{ repo_pkg_cache_port }}"
haproxy_balance_type: http
haproxy_backend_options:
- "httpchk HEAD /acng-report.html HTTP/1.0\\r\\nUser-agent:\\ osa-haproxy-healthcheck"
haproxy_whitelist_networks: "{{ haproxy_repo_cache_whitelist_networks }}"
haproxy_service_enabled: "{{ groups['repo_all'] is defined and groups['repo_all'] | length > 0 }}"
- service:
haproxy_service_name: glance_api
haproxy_backend_nodes: "{{ groups['glance_api'] | default([]) }}"

View File

@ -13,28 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Test proxy URL for connectivity
run_once: yes
uri:
url: "{{ repo_pkg_cache_url }}/acng-report.html"
method: "HEAD"
timeout: 3
register: proxy_check
failed_when: false
tags:
- common-proxy
- name: Add apt package manager proxy
copy:
content: 'Acquire::http { Proxy "{{ repo_pkg_cache_url }}"; };'
dest: "/etc/apt/apt.conf.d/00apt-cacher-proxy"
register: _apt_proxy_added
when:
- repo_pkg_cache_enabled | bool
- proxy_check.status == 200
- ansible_os_family == 'Debian'
tags:
- common-proxy
# TODO(odyssey4me):
# Remove these tasks in T. They are only present for the
# Q->R upgrade or for R->S upgrades for environments which
# were installed prior to R's release.
- name: Remove apt package manager proxy
file:
@ -42,8 +24,6 @@
state: "absent"
register: _apt_proxy_removed
when:
- repo_pkg_cache_enabled | bool
- proxy_check.status != 200
- ansible_os_family == 'Debian'
tags:
- common-proxy
@ -54,34 +34,34 @@
retries: 5
delay: 2
when:
- (_apt_proxy_added is mapping and _apt_proxy_added | changed) or
(_apt_proxy_removed is mapping and _apt_proxy_removed | changed)
- _apt_proxy_removed is mapping
- _apt_proxy_removed | changed
tags:
- common-proxy
# NOTE(mhayden): We always deploy the proxy configuration for yum on CentOS
# even if dnf is present.
- name: Deploy yum package manager proxy
- name: Remove yum package manager proxy
lineinfile:
line: 'proxy={{ repo_pkg_cache_url }}'
line: >-
proxy="http://{{ internal_lb_vip_address }}:{{ repo_pkg_cache_port | default('3142') }}"
dest: "/etc/yum.conf"
state: "{{ (proxy_check.status == 200) | ternary('present', 'absent') }}"
state: absent
when:
- ansible_os_family == 'RedHat'
- repo_pkg_cache_enabled | bool
tags:
- common-proxy
# NOTE(mhayden): If dnf and yum are installed on CentOS, we need to configure
# a proxy for dnf as well.
- name: Deploy dnf package manager proxy
- name: Remove dnf package manager proxy
lineinfile:
line: 'proxy={{ repo_pkg_cache_url }}'
line: >-
proxy="http://{{ internal_lb_vip_address }}:{{ repo_pkg_cache_port | default('3142') }}"
dest: "/etc/dnf/dnf.conf"
state: "{{ (proxy_check.status == 200) | ternary('present', 'absent') }}"
state: absent
when:
- ansible_os_family == 'RedHat'
- ansible_pkg_mgr == 'dnf'
- repo_pkg_cache_enabled | bool
tags:
- common-proxy

View File

@ -90,20 +90,6 @@
- healthcheck
- healthcheck-repo-use
- name: Sanity checks for all containers
hosts: all_containers:physical_hosts
gather_facts: yes
tasks:
- name: Ensure everyone can reach apt proxy
uri:
url: "{{ repo_pkg_cache_url }}/acng-report.html"
method: "HEAD"
when:
- "ansible_pkg_mgr == 'apt'"
tags:
- healthcheck
- healthcheck-repo-use
# Test utility-install.yml
- name: Ensure the service setup host is ready to run openstack calls
hosts: "{{ openstack_service_setup_host | default('localhost') }}"