Add quorum queues support for service

This change implements and enables by default quorum support
for rabbitmq as well as providing default variables to globally tune
it's behaviour.

In order to ensure upgrade path and ability to switch back to HA queues
we change vhost names with removing leading `/`, as enabling quorum
requires to remove exchange which is tricky thing to do with running
services.

Change-Id: Id5f6cabed7ec035845865d6d5facc63590c56d43
This commit is contained in:
Dmitriy Rabotyagov 2023-11-10 17:05:45 +01:00 committed by Dmitriy Rabotyagov
parent ee795c740c
commit 0ba35bf841
3 changed files with 17 additions and 2 deletions

View File

@ -196,10 +196,19 @@ swift_oslomsg_notify_servers: "{{ oslomsg_notify_servers | default('127.0.0.1')
swift_oslomsg_notify_port: "{{ oslomsg_notify_port | default('5672') }}" swift_oslomsg_notify_port: "{{ oslomsg_notify_port | default('5672') }}"
swift_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl | default(False) }}" swift_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl | default(False) }}"
swift_oslomsg_notify_userid: swift swift_oslomsg_notify_userid: swift
swift_oslomsg_notify_vhost: /swift swift_oslomsg_notify_vhost:
- name: /swift
state: "{{ swift_oslomsg_rabbit_quorum_queues | ternary('absent', 'present') }}"
- name: swift
state: "{{ swift_oslomsg_rabbit_quorum_queues | ternary('present', 'absent') }}"
swift_oslomsg_notify_ssl_version: "{{ oslomsg_notify_ssl_version | default('TLSv1_2') }}" swift_oslomsg_notify_ssl_version: "{{ oslomsg_notify_ssl_version | default('TLSv1_2') }}"
swift_oslomsg_notify_ssl_ca_file: "{{ oslomsg_notify_ssl_ca_file | default('') }}" swift_oslomsg_notify_ssl_ca_file: "{{ oslomsg_notify_ssl_ca_file | default('') }}"
swift_oslomsg_rabbit_quorum_queues: "{{ oslomsg_rabbit_quorum_queues | default(True) }}"
swift_oslomsg_rabbit_quorum_delivery_limit: "{{ oslomsg_rabbit_quorum_delivery_limit | default(0) }}"
swift_oslomsg_rabbit_quorum_max_memory_bytes: "{{ oslomsg_rabbit_quorum_max_memory_bytes | default(0) }}"
## General Swift configuration ## General Swift configuration
# We are not capping the default value for these swift variables which define # We are not capping the default value for these swift variables which define
# the number of worker threads for each of the swift services (except the swift # the number of worker threads for each of the swift services (except the swift

View File

@ -176,7 +176,7 @@ use = egg:swift#xprofile
paste.filter_factory = ceilometermiddleware.swift:filter_factory paste.filter_factory = ceilometermiddleware.swift:filter_factory
control_exchange = swift control_exchange = swift
driver = messagingv2 driver = messagingv2
url = {{ swift_oslomsg_notify_transport }}://{% for host in swift_oslomsg_notify_servers.split(',') %}{{ swift_oslomsg_notify_userid }}:{{ swift_oslomsg_notify_password }}@{{ host }}:{{ swift_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ swift_oslomsg_notify_vhost }}{% if swift_oslomsg_notify_use_ssl | bool %}?ssl=1&ssl_version={{ swift_oslomsg_notify_ssl_version }}&ssl_ca_file={{ swift_oslomsg_notify_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} url = {{ swift_oslomsg_notify_transport }}://{% for host in swift_oslomsg_notify_servers.split(',') %}{{ swift_oslomsg_notify_userid }}:{{ swift_oslomsg_notify_password }}@{{ host }}:{{ swift_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ _swift_oslomsg_notify_vhost_conf }}{% if swift_oslomsg_notify_use_ssl | bool %}?ssl=1&ssl_version={{ swift_oslomsg_notify_ssl_version }}&ssl_ca_file={{ swift_oslomsg_notify_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %}
topic = notifications topic = notifications
{% if gnocchi_service_project_name is defined %} {% if gnocchi_service_project_name is defined %}

View File

@ -21,6 +21,12 @@ _swift_proxy_is_first_play_host: >-
_swift_is_first_play_host: >- _swift_is_first_play_host: >-
{{ ('swift_hosts' in group_names and inventory_hostname == (groups['swift_hosts'] | intersect(ansible_play_hosts)) | first) | bool }} {{ ('swift_hosts' in group_names and inventory_hostname == (groups['swift_hosts'] | intersect(ansible_play_hosts)) | first) | bool }}
_swift_oslomsg_notify_vhost_conf: >-
{{
(swift_oslomsg_notify_vhost is string) | ternary(
swift_oslomsg_notify_vhost, swift_oslomsg_notify_vhost | selectattr('state', 'eq', 'present') | map(attribute='name') | first)
}}
filtered_swift_services: |- filtered_swift_services: |-
{% set services = [] %} {% set services = [] %}
{% for key,value in swift_services.items() %} {% for key,value in swift_services.items() %}