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/608631
Change-Id: Ia0fb41266a6d62073b02c8ad6fa97b8b7d408a67
This commit is contained in:
Jesse Pretorius 2018-10-08 11:53:21 +01:00 committed by Jesse Pretorius (odyssey4me)
parent e1aabd05b8
commit 43a5c874ef
4 changed files with 14 additions and 62 deletions

View File

@ -56,9 +56,6 @@ rsyslog_server_enabled: "{{ ansible_pkg_mgr == 'zypper' }}"
# URL for the frozen internal openstack repo. # URL for the frozen internal openstack repo.
repo_server_port: 8181 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 ## Default installation method for OpenStack services
install_method: "source" install_method: "source"

View File

@ -71,17 +71,6 @@ haproxy_default_services:
haproxy_backend_options: haproxy_backend_options:
- "httpchk HEAD / HTTP/1.0\\r\\nUser-agent:\\ osa-haproxy-healthcheck" - "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 }}" 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: - service:
haproxy_service_name: glance_api haproxy_service_name: glance_api
haproxy_backend_nodes: "{{ groups['glance_api'] | default([]) }}" haproxy_backend_nodes: "{{ groups['glance_api'] | default([]) }}"

View File

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

View File

@ -90,20 +90,6 @@
- healthcheck - healthcheck
- healthcheck-repo-use - 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 # Test utility-install.yml
- name: Ensure the service setup host is ready to run openstack calls - name: Ensure the service setup host is ready to run openstack calls
hosts: "{{ openstack_service_setup_host | default('localhost') }}" hosts: "{{ openstack_service_setup_host | default('localhost') }}"