From 2470c016933ee48420d3ab6dd982d0c1d2d8e3e4 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Mon, 21 Aug 2017 12:24:47 +0100 Subject: [PATCH] Remove unused/unnecessary haproxy_server vars/files The repo/keys are left over from Newton/Trusty and were not removed when Trusty support was removed. The required packages were only necessary in order to facilitate the repo addition. The var haproxy_distro_packages is defined in all distro-specific vars files, so its presence in defaults is unnecessary. The apt pinning meta dependency is no longer required - it's another leftover from Ubuntu Trusty. A task is included to remove the old config files. Change-Id: I912cd170d05c4a9befe3420971ddf68ff2ddde2b --- defaults/main.yml | 6 ------ meta/main.yml | 9 +-------- ...ve-haproxy-repo-vars-051a47bbfaf6d1da.yaml | 8 ++++++++ tasks/haproxy_pre_install.yml | 9 +++++++++ vars/ubuntu-16.04.yml | 19 ++++++++++++++----- 5 files changed, 32 insertions(+), 19 deletions(-) create mode 100644 releasenotes/notes/remove-haproxy-repo-vars-051a47bbfaf6d1da.yaml diff --git a/defaults/main.yml b/defaults/main.yml index f17bbff..e665bc6 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -26,12 +26,6 @@ haproxy_rise: 3 haproxy_fall: 3 haproxy_interval: 12000 -## Haproxy standard API -haproxy_repo: {} -haproxy_gpg_keys: [] -haproxy_required_distro_packages: [] -haproxy_distro_packages: [] - ## Haproxy Stats haproxy_stats_enabled: False haproxy_stats_bind_address: 127.0.0.1 diff --git a/meta/main.yml b/meta/main.yml index 63a3841..51647ea 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -36,11 +36,4 @@ galaxy_info: - python - development - openstack -dependencies: - - role: apt_package_pinning - apt_pinned_packages: [{ package: "*", release: LP-PPA-vbernat-haproxy-1.5, priority: "1001" }] - apt_package_pinning_file_name: "haproxy_pin.pref" - when: - - ansible_pkg_mgr == 'apt' - - haproxy_ssl | bool - - ansible_distribution_version | version_compare('16.04', '<') +dependencies: [] diff --git a/releasenotes/notes/remove-haproxy-repo-vars-051a47bbfaf6d1da.yaml b/releasenotes/notes/remove-haproxy-repo-vars-051a47bbfaf6d1da.yaml new file mode 100644 index 0000000..59c7348 --- /dev/null +++ b/releasenotes/notes/remove-haproxy-repo-vars-051a47bbfaf6d1da.yaml @@ -0,0 +1,8 @@ +--- +upgrade: + - | + The following variables have been removed from the ``haproxy_server`` role + as they are no longer necessary or used. + - haproxy_repo + - haproxy_gpg_keys + - haproxy_required_distro_packages diff --git a/tasks/haproxy_pre_install.yml b/tasks/haproxy_pre_install.yml index 26dc738..5319279 100644 --- a/tasks/haproxy_pre_install.yml +++ b/tasks/haproxy_pre_install.yml @@ -87,3 +87,12 @@ path: "/etc/haproxy/conf.d" state: directory mode: "0755" + +- name: Remove old config files + file: + path: "{{ item }}" + state: absent + with_items: + - "{{ haproxy_remove_files }}" + when: + - ansible_pkg_mgr == 'apt' diff --git a/vars/ubuntu-16.04.yml b/vars/ubuntu-16.04.yml index 75f62ea..a2e8cf7 100644 --- a/vars/ubuntu-16.04.yml +++ b/vars/ubuntu-16.04.yml @@ -16,14 +16,23 @@ ## APT Cache options cache_timeout: 600 -haproxy_required_distro_packages: - - python-software-properties - - software-properties-common - - debconf-utils - haproxy_distro_packages: - haproxy - netcat # Used for the Ansible haproxy module - psmisc - rsyslog # Used for local logging - vim-haproxy + +# This file list is to handle upgrades +# from previous versions where an apt +# pinning config file or repo config +# file was put in place to use a PPA +# for Newton/Trusty. Unfortunately +# some file config info was left in +# place long after Trusty support was +# removed, so the removal of these +# files is still necessary. +haproxy_remove_files: + - "/etc/apt/preferences.d/haproxy_pin.pref" + - "/etc/apt/sources.list.d/haproxy.list" + - "/etc/apt/sources.list.d/ppa_launchpad_net_vbernat_haproxy_1_5_ubuntu.list"