Add coordination support

This patch adds configuration for coordination service when cinder
active/active setup is used and coordination hosts exist

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/864750
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/865805
Change-Id: I2dda4c74aa69aea3ecea92954922dbfe1bd56687
This commit is contained in:
Dmitriy Rabotyagov 2022-11-24 10:55:44 +01:00 committed by Dmitriy Rabotyagov
parent dd9051ed36
commit 789d14de9d
3 changed files with 23 additions and 0 deletions

View File

@ -110,6 +110,16 @@ cinder_oslomsg_notify_ssl_ca_file: "{{ oslomsg_notify_ssl_ca_file | default('')
# TODO(evrardjp): Change structure when more backends will be supported
cinder_oslomsg_amqp1_enabled: "{{ cinder_oslomsg_rpc_transport == 'amqp' }}"
## Coordintation
cinder_coordination_driver: "{{ coordination_driver | default('zookeeper') }}"
cinder_coordination_group: "{{ coordination_host_group | default('zookeeper_all') }}"
cinder_coordination_enable: "{{ cinder_active_active_cluster and (cinder_coordination_group in groups and groups[cinder_coordination_group] | length > 0) }}"
cinder_coordination_namespace: cinder
cinder_coordination_client_ssl: "{{ coordination_client_ssl | default(False) }}"
cinder_coordination_verify_cert: "{{ coordination_verify_cert | default(True) }}"
cinder_coordination_port: "{{ coordination_port | default(cinder_coordination_client_ssl | ternary('2281', '2181')) }}"
cinder_coordination_url: "{{ _cinder_coordination_url | default() }}"
## Cinder User / Group
cinder_system_user_name: cinder
cinder_system_group_name: cinder
@ -312,6 +322,7 @@ cinder_pip_packages:
- pymemcache
- python-memcached
- systemd-python
- "tooz[{{ cinder_coordination_driver }}]"
# Specific pip packages provided by the user
cinder_user_pip_packages: []

View File

@ -111,6 +111,11 @@ allowed_direct_url_schemes = cinder
{% endfor %}
{% endif %}
{% if cinder_coordination_enable %}
[coordination]
backend_url = {{ cinder_coordination_url }}
{% endif %}
[backend_defaults]
target_helper = {{ cinder_target_helper }}

View File

@ -122,3 +122,10 @@ cinder_service_catalog:
state: present
_cinder_oslomsg_heartbeat_in_pthread: "{{ (cinder_services['cinder-volume']['group'] in group_names) | ternary(False, True) }}"
_cinder_coordination_url: >-
{{ cinder_coordination_driver }}://{{
groups[cinder_coordination_group]
| map('extract', hostvars, 'ansible_host')
| list | join(':' ~ cinder_coordination_port ~ ',')
}}:{{ cinder_coordination_port }}?namespace={{ cinder_coordination_namespace }}{% if cinder_coordination_client_ssl | bool %}&use_ssl=True&verify_certs={{ cinder_coordination_verify_cert | bool }}{% endif %}