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: I9b9de6cdfac8ba3a89b874cd920df8d5b01e81f2
This commit is contained in:
Dmitriy Rabotyagov 2023-10-20 13:56:46 +02:00 committed by Dmitriy Rabotyagov
parent 59c2e45f6d
commit c15dc767fd
3 changed files with 29 additions and 3 deletions

View File

@ -75,7 +75,13 @@ tacker_oslomsg_rpc_servers: "{{ oslomsg_rpc_servers | default('127.0.0.1') }}"
tacker_oslomsg_rpc_port: "{{ oslomsg_rpc_port | default('5672') }}" tacker_oslomsg_rpc_port: "{{ oslomsg_rpc_port | default('5672') }}"
tacker_oslomsg_rpc_use_ssl: "{{ oslomsg_rpc_use_ssl | default(False) }}" tacker_oslomsg_rpc_use_ssl: "{{ oslomsg_rpc_use_ssl | default(False) }}"
tacker_oslomsg_rpc_userid: tacker tacker_oslomsg_rpc_userid: tacker
tacker_oslomsg_rpc_vhost: /tacker # vhost name depends on value of oslomsg_rabbit_quorum_queues. In case quorum queues
# are not used - vhost name will be prefixed with leading `/`.
tacker_oslomsg_rpc_vhost:
- name: /tacker
state: "{{ tacker_oslomsg_rabbit_quorum_queues | ternary('absent', 'present') }}"
- name: tacker
state: "{{ tacker_oslomsg_rabbit_quorum_queues | ternary('present', 'absent') }}"
tacker_oslomsg_rpc_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }}" tacker_oslomsg_rpc_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }}"
tacker_oslomsg_rpc_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}" tacker_oslomsg_rpc_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
@ -92,6 +98,11 @@ tacker_oslomsg_notify_vhost: "{{ tacker_oslomsg_rpc_vhost }}"
tacker_oslomsg_notify_ssl_version: "{{ oslomsg_notify_ssl_version | default('TLSv1_2') }}" tacker_oslomsg_notify_ssl_version: "{{ oslomsg_notify_ssl_version | default('TLSv1_2') }}"
tacker_oslomsg_notify_ssl_ca_file: "{{ oslomsg_notify_ssl_ca_file | default('') }}" tacker_oslomsg_notify_ssl_ca_file: "{{ oslomsg_notify_ssl_ca_file | default('') }}"
## RabbitMQ integration
tacker_oslomsg_rabbit_quorum_queues: "{{ oslomsg_rabbit_quorum_queues | default(True) }}"
tacker_oslomsg_rabbit_quorum_delivery_limit: "{{ oslomsg_rabbit_quorum_delivery_limit | default(0) }}"
tacker_oslomsg_rabbit_quorum_max_memory_bytes: "{{ oslomsg_rabbit_quorum_max_memory_bytes | default(0) }}"
## (Qdrouterd) integration ## (Qdrouterd) integration
# TODO(ansmith): Change structure when more backends will be supported # TODO(ansmith): Change structure when more backends will be supported
tacker_oslomsg_amqp1_enabled: "{{ tacker_oslomsg_rpc_transport == 'amqp' }}" tacker_oslomsg_amqp1_enabled: "{{ tacker_oslomsg_rpc_transport == 'amqp' }}"

View File

@ -4,7 +4,7 @@
debug = {{ debug }} debug = {{ debug }}
# oslo.messaging rpc transport # oslo.messaging rpc transport
transport_url = {{ tacker_oslomsg_rpc_transport }}://{% for host in tacker_oslomsg_rpc_servers.split(',') %}{{ tacker_oslomsg_rpc_userid }}:{{ tacker_oslomsg_rpc_password }}@{{ host }}:{{ tacker_oslomsg_rpc_port }}{% if not loop.last %},{% else %}/{{ tacker_oslomsg_rpc_vhost }}{% if tacker_oslomsg_rpc_use_ssl | bool %}?ssl=1&ssl_version={{ tacker_oslomsg_rpc_ssl_version }}&ssl_ca_file={{ tacker_oslomsg_rpc_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} transport_url = {{ tacker_oslomsg_rpc_transport }}://{% for host in tacker_oslomsg_rpc_servers.split(',') %}{{ tacker_oslomsg_rpc_userid }}:{{ tacker_oslomsg_rpc_password }}@{{ host }}:{{ tacker_oslomsg_rpc_port }}{% if not loop.last %},{% else %}/{{ _tacker_oslomsg_rpc_vhost_conf }}{% if tacker_oslomsg_rpc_use_ssl | bool %}?ssl=1&ssl_version={{ tacker_oslomsg_rpc_ssl_version }}&ssl_ca_file={{ tacker_oslomsg_rpc_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %}
# Where to store Tacker state files. This directory must be writable by the # Where to store Tacker state files. This directory must be writable by the
# user executing the agent. # user executing the agent.
@ -96,7 +96,10 @@ openstack = {{ tacker_etc_dir }}/vim/fernet_keys
[oslo_messaging_rabbit] [oslo_messaging_rabbit]
ssl = {{ tacker_oslomsg_notify_use_ssl | bool }} ssl = {{ tacker_oslomsg_notify_use_ssl | bool }}
rabbit_quorum_queue = {{ tacker_oslomsg_rabbit_quorum_queues }}
rabbit_quorum_delivery_limit = {{ tacker_oslomsg_rabbit_quorum_delivery_limit }}
rabbit_quorum_max_memory_bytes = {{ tacker_oslomsg_rabbit_quorum_max_memory_bytes }}
[oslo_messaging_notifications] [oslo_messaging_notifications]
driver = {{ (tacker_ceilometer_enabled | bool) | ternary('messagingv2', 'noop') }} driver = {{ (tacker_ceilometer_enabled | bool) | ternary('messagingv2', 'noop') }}
transport_url = {{ tacker_oslomsg_notify_transport }}://{% for host in tacker_oslomsg_notify_servers.split(',') %}{{ tacker_oslomsg_notify_userid }}:{{ tacker_oslomsg_notify_password }}@{{ host }}:{{ tacker_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ tacker_oslomsg_notify_vhost }}{% if tacker_oslomsg_notify_use_ssl | bool %}?ssl=1&ssl_version={{ tacker_oslomsg_notify_ssl_version }}&ssl_ca_file={{ tacker_oslomsg_notify_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} transport_url = {{ tacker_oslomsg_notify_transport }}://{% for host in tacker_oslomsg_notify_servers.split(',') %}{{ tacker_oslomsg_notify_userid }}:{{ tacker_oslomsg_notify_password }}@{{ host }}:{{ tacker_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ _tacker_oslomsg_notify_vhost_conf }}{% if tacker_oslomsg_notify_use_ssl | bool %}?ssl=1&ssl_version={{ tacker_oslomsg_notify_ssl_version }}&ssl_ca_file={{ tacker_oslomsg_notify_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %}

View File

@ -17,3 +17,15 @@
_tacker_is_first_play_host: >- _tacker_is_first_play_host: >-
{{ ('tacker_all' in group_names and inventory_hostname == (groups['tacker_all'] | intersect(ansible_play_hosts)) | first) | bool }} {{ ('tacker_all' in group_names and inventory_hostname == (groups['tacker_all'] | intersect(ansible_play_hosts)) | first) | bool }}
_tacker_oslomsg_rpc_vhost_conf: >-
{{
(tacker_oslomsg_rpc_vhost is string) | ternary(
tacker_oslomsg_rpc_vhost, tacker_oslomsg_rpc_vhost | selectattr('state', 'eq', 'present') | map(attribute='name') | first)
}}
_tacker_oslomsg_notify_vhost_conf: >-
{{
(tacker_oslomsg_notify_vhost is string) | ternary(
tacker_oslomsg_notify_vhost, tacker_oslomsg_notify_vhost | selectattr('state', 'eq', 'present') | map(attribute='name') | first)
}}