Avoid breaking horizon during Antelope upgrade

During Antelope upgrade, haproxy-install.yml configures base service
listening on ports 80 and 443.
But at this point, horizon frontend is not removed yet so haproxy has
two frontends listening on 80/443.
During os-horizon-install.yml, horizon frontend is removed and
appropriate haproxy maps config is applied.
As a result, between haproxy-install.yml and os-horizon-install.yml,
horizon will encounter intermittent issues.
This patch triggers horizon service reconfiguration during Antelope
upgrade when running haproxy-install.yml playbook.
To be precise: when horizon is already deployed in an environement but
its maps config is not there yet, haproxy will trigger reconfiguration
of horizon service.
This change is intendent to land only in 2023.1. Upgrades from 2023.1
to 2023.2 or 2024.1 are not affected.

Closes-Bug: #2028944
Change-Id: I9df78f286c1fcc3204b35928829a981addf876e8
This commit is contained in:
Damian Dabrowski 2023-08-11 17:38:07 +02:00 committed by Dmitriy Rabotyagov
parent f22ad8f715
commit 7f2af14614
1 changed files with 28 additions and 0 deletions

View File

@ -57,6 +57,34 @@
- role: "haproxy_server"
haproxy_service_configs: "{{ haproxy_default_services + haproxy_extra_services | default([]) }}"
post_tasks:
# NOTE(damiandabrowski): https://bugs.launchpad.net/openstack-ansible/+bug/2028944
- name: Avoid breaking horizon during Antelope upgrade
tags: haproxy-service-config
block:
- name: Check if horizon service is already deployed
stat:
path: /etc/haproxy/conf.d/horizon
register: _horizon_service_conf
- name: Check if haproxy maps for horizon are already configured
stat:
path: /etc/haproxy/map.conf.d/base_regex/99-horizon.map
register: _horizon_map_conf
# Horizon needs to be fixed only if its already deployed in an
# environment but appropriate map file is not created yet
- name: Configure horizon service
include_role:
name: haproxy_server
tasks_from: haproxy_service_config_external.yml
vars:
haproxy_service_configs: >-
{{ hostvars[groups['horizon_all'][0]]['horizon_haproxy_services'] }}
when:
- _horizon_service_conf.stat.exists
- not _horizon_map_conf.stat.exists
environment: "{{ deployment_environment_variables | default({}) }}"
tags:
- haproxy-config