From 43a5c874ef7ff1c43c51086022655bb44492794e Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Mon, 8 Oct 2018 11:53:21 +0100 Subject: [PATCH] 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 --- inventory/group_vars/all/all.yml | 3 -- inventory/group_vars/haproxy/haproxy.yml | 11 ----- .../common-tasks/package-cache-proxy.yml | 48 ++++++------------- playbooks/healthcheck-infrastructure.yml | 14 ------ 4 files changed, 14 insertions(+), 62 deletions(-) diff --git a/inventory/group_vars/all/all.yml b/inventory/group_vars/all/all.yml index 43f3839888..332b845af3 100644 --- a/inventory/group_vars/all/all.yml +++ b/inventory/group_vars/all/all.yml @@ -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" diff --git a/inventory/group_vars/haproxy/haproxy.yml b/inventory/group_vars/haproxy/haproxy.yml index 92f5f23fa2..16adf4e62d 100644 --- a/inventory/group_vars/haproxy/haproxy.yml +++ b/inventory/group_vars/haproxy/haproxy.yml @@ -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([]) }}" diff --git a/playbooks/common-tasks/package-cache-proxy.yml b/playbooks/common-tasks/package-cache-proxy.yml index 43cebcdaa9..8365fdda52 100644 --- a/playbooks/common-tasks/package-cache-proxy.yml +++ b/playbooks/common-tasks/package-cache-proxy.yml @@ -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 diff --git a/playbooks/healthcheck-infrastructure.yml b/playbooks/healthcheck-infrastructure.yml index 70b091693b..4159cda048 100644 --- a/playbooks/healthcheck-infrastructure.yml +++ b/playbooks/healthcheck-infrastructure.yml @@ -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') }}"