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 <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2018-10-02 23:40:21 -05:00 committed by Kevin Carter
parent 87b3926ed1
commit 7fc3f62c73
3 changed files with 19 additions and 51 deletions

View File

@ -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

View File

@ -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):

View File

@ -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