From 7fc3f62c730eca9ca875b3f155aa9af58443ba33 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Tue, 2 Oct 2018 23:40:21 -0500 Subject: [PATCH] Add tasks to remove legacy files The change removes legacy files which conflict with new services being deployed during a rolling upgrade. This change adds two tasks to remove any legacy files should they be found and removes old cleanup handlers that are no longer in service. Change-Id: Ie593a80e0e6708c50f7809171fa47c7043a2e136 Signed-off-by: Kevin Carter --- handlers/main.yml | 40 ---------------------------------------- tasks/keystone_nginx.yml | 21 ++++++++++----------- tasks/keystone_uwsgi.yml | 9 +++++++++ 3 files changed, 19 insertions(+), 51 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 0b60b591..92a75cac 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -54,46 +54,6 @@ - "venv changed" - "Restart uWSGI" -# NOTE(mnaser): This should be removed in the Stein cycle -- name: Stop and disable keystone-wsgi-admin - shell: | - return_code=0 - if [[ "$(systemctl is-active keystone-wsgi-admin)" == "active" ]]; then - systemctl stop keystone-wsgi-admin - return_code=2 - fi - if [[ "$(systemctl is-enabled keystone-wsgi-admin)" == "enabled" ]]; then - systemctl disable keystone-wsgi-admin - return_code=2 - fi - exit ${return_code} - args: - executable: /bin/bash - register: _remove_admin_service - changed_when: _remove_admin_service.rc == 2 - failed_when: _remove_admin_service.rc not in [0, 2] - listen: "Restart uWSGI" - # This task causes ansible-lint to give a ANSIBLE0014 - # error, which does not make much sense given how the - # environment variable is used in this case. - # TODO(odyssey4me): - # Try to understand the issue ansible-lint is trying - # to highlight and address it. - tags: - - skip_ansible_lint - -# NOTE(mnaser): This should be removed in the Stein cycle -- name: Clean up keystone-wsgi-admin service files - file: - path: "{{ item }}" - state: absent - with_items: - - "/etc/tmpfiles.d/openstack-keystone-wsgi-admin.conf" - - "/etc/systemd/system/keystone-wsgi-admin.service" - - "/etc/uwsgi/keystone-wsgi-admin.ini" - - "/var/www/cgi-bin/keystone/admin" - listen: "Restart uWSGI" - # Note (odyssey4me): # The policy.json file is currently read continually by the services # and is not only read on service start. We therefore cannot template diff --git a/tasks/keystone_nginx.yml b/tasks/keystone_nginx.yml index 5cdf0c77..f8986783 100644 --- a/tasks/keystone_nginx.yml +++ b/tasks/keystone_nginx.yml @@ -27,6 +27,16 @@ - Manage LB - Restart web server +# TODO(cloudnull): +# This is to cater for Q-R, R-S upgrades and can be removed in T +- name: Remove legacy nginx config + file: + path: /etc/nginx/sites-enabled/keystone-wsgi-admin.conf + state: absent + notify: + - Manage LB + - Restart web server + - name: Ensure configuration directories exist file: path: "{{ item }}" @@ -35,17 +45,6 @@ - "/etc/nginx/{{ keystone_nginx_conf_path }}" - "/etc/nginx/conf.d" -# TODO(odyssey4me): -# This is to cater for P->Q, Q-R upgrades and can be removed in S -- name: Remove previously implemented custom nginx log format - lineinfile: - dest: "/etc/nginx/nginx.conf" - line: "log_format custom '{{ keystone_nginx_access_log_format_combined }} {{ keystone_nginx_access_log_format_extras }}';" - state: absent - notify: - - Manage LB - - Restart web server - - name: Configure custom nginx log format copy: # NOTE(odyssey4me): diff --git a/tasks/keystone_uwsgi.yml b/tasks/keystone_uwsgi.yml index 9fd2e72b..7435d561 100644 --- a/tasks/keystone_uwsgi.yml +++ b/tasks/keystone_uwsgi.yml @@ -61,3 +61,12 @@ tags: - keystone-config - systemd-service + +# This is to cater for Q-R, R-S upgrades and can be removed in T +- name: Stop and disable keystone-wsgi-admin + file: + path: /etc/systemd/system/keystone-wsgi-admin.service + state: absent + notify: + - Manage LB + - Restart web server