diff --git a/defaults/main.yml b/defaults/main.yml index 6161642d..1b0c0551 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -98,7 +98,13 @@ cinder_oslomsg_rpc_servers: "{{ oslomsg_rpc_servers | default('127.0.0.1') }}" cinder_oslomsg_rpc_port: "{{ oslomsg_rpc_port | default('5672') }}" cinder_oslomsg_rpc_use_ssl: "{{ oslomsg_rpc_use_ssl | default(False) }}" cinder_oslomsg_rpc_userid: cinder -cinder_oslomsg_rpc_vhost: /cinder +# vhost name depends on value of oslomsg_rabbit_quorum_queues. In case quorum queues +# are not used - vhost name will be prefixed with leading `/`. +cinder_oslomsg_rpc_vhost: + - name: /cinder + state: "{{ cinder_oslomsg_rabbit_quorum_queues | ternary('absent', 'present') }}" + - name: cinder + state: "{{ cinder_oslomsg_rabbit_quorum_queues | ternary('present', 'absent') }}" cinder_oslomsg_rpc_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }}" cinder_oslomsg_rpc_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}" @@ -115,6 +121,11 @@ cinder_oslomsg_notify_vhost: "{{ cinder_oslomsg_rpc_vhost }}" cinder_oslomsg_notify_ssl_version: "{{ oslomsg_notify_ssl_version | default('TLSv1_2') }}" cinder_oslomsg_notify_ssl_ca_file: "{{ oslomsg_notify_ssl_ca_file | default('') }}" +## RabbitMQ integration +cinder_oslomsg_rabbit_quorum_queues: "{{ oslomsg_rabbit_quorum_queues | default(True) }}" +cinder_oslomsg_rabbit_quorum_delivery_limit: "{{ oslomsg_rabbit_quorum_delivery_limit | default(0) }}" +cinder_oslomsg_rabbit_quorum_max_memory_bytes: "{{ oslomsg_rabbit_quorum_max_memory_bytes | default(0) }}" + ## (Qdrouterd) integration # TODO(evrardjp): Change structure when more backends will be supported cinder_oslomsg_amqp1_enabled: "{{ cinder_oslomsg_rpc_transport == 'amqp' }}" diff --git a/templates/cinder.conf.j2 b/templates/cinder.conf.j2 index afd920e1..299b97d0 100644 --- a/templates/cinder.conf.j2 +++ b/templates/cinder.conf.j2 @@ -55,7 +55,7 @@ backup_ceph_pool = {{ cinder_service_backup_ceph_pool }} executor_thread_pool_size = {{ cinder_rpc_executor_thread_pool_size }} rpc_response_timeout = {{ cinder_rpc_response_timeout }} -transport_url = {{ cinder_oslomsg_rpc_transport }}://{% for host in cinder_oslomsg_rpc_servers.split(',') %}{{ cinder_oslomsg_rpc_userid }}:{{ cinder_oslomsg_rpc_password }}@{{ host }}:{{ cinder_oslomsg_rpc_port }}{% if not loop.last %},{% else %}/{{ cinder_oslomsg_rpc_vhost }}{% if cinder_oslomsg_rpc_use_ssl | bool %}?ssl=1&ssl_version={{ cinder_oslomsg_rpc_ssl_version }}&ssl_ca_file={{ cinder_oslomsg_rpc_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} +transport_url = {{ cinder_oslomsg_rpc_transport }}://{% for host in cinder_oslomsg_rpc_servers.split(',') %}{{ cinder_oslomsg_rpc_userid }}:{{ cinder_oslomsg_rpc_password }}@{{ host }}:{{ cinder_oslomsg_rpc_port }}{% if not loop.last %},{% else %}/{{ _cinder_oslomsg_rpc_vhost_conf }}{% if cinder_oslomsg_rpc_use_ssl | bool %}?ssl=1&ssl_version={{ cinder_oslomsg_rpc_ssl_version }}&ssl_ca_file={{ cinder_oslomsg_rpc_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} ## Quota quota_volumes = {{ cinder_quota_volumes }} @@ -128,10 +128,13 @@ connection_recycle_time = {{ cinder_db_connection_recycle_time }} [oslo_messaging_rabbit] heartbeat_in_pthread = {{ cinder_oslomsg_heartbeat_in_pthread }} +rabbit_quorum_queue = {{ cinder_oslomsg_rabbit_quorum_queues }} +rabbit_quorum_delivery_limit = {{ cinder_oslomsg_rabbit_quorum_delivery_limit }} +rabbit_quorum_max_memory_bytes = {{ cinder_oslomsg_rabbit_quorum_max_memory_bytes }} [oslo_messaging_notifications] driver = {{ (cinder_ceilometer_enabled | bool) | ternary('messagingv2', 'noop') }} -transport_url = {{ cinder_oslomsg_notify_transport }}://{% for host in cinder_oslomsg_notify_servers.split(',') %}{{ cinder_oslomsg_notify_userid }}:{{ cinder_oslomsg_notify_password }}@{{ host }}:{{ cinder_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ cinder_oslomsg_notify_vhost }}{% if cinder_oslomsg_notify_use_ssl | bool %}?ssl=1&ssl_version={{ cinder_oslomsg_notify_ssl_version }}&ssl_ca_file={{ cinder_oslomsg_notify_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} +transport_url = {{ cinder_oslomsg_notify_transport }}://{% for host in cinder_oslomsg_notify_servers.split(',') %}{{ cinder_oslomsg_notify_userid }}:{{ cinder_oslomsg_notify_password }}@{{ host }}:{{ cinder_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ _cinder_oslomsg_notify_vhost_conf }}{% if cinder_oslomsg_notify_use_ssl | bool %}?ssl=1&ssl_version={{ cinder_oslomsg_notify_ssl_version }}&ssl_ca_file={{ cinder_oslomsg_notify_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} [oslo_concurrency] lock_path = {{ cinder_lock_dir }}/{{ cinder_system_slice_name }} diff --git a/vars/main.yml b/vars/main.yml index 1815c27e..36834b5a 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -34,6 +34,9 @@ _cinder_rootwrap_conf_overrides: filters_path: "/etc/cinder/rootwrap.d,/usr/share/cinder/rootwrap" exec_dirs: "{{ cinder_bin }},/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin" +_cinder_oslomsg_rpc_vhost_conf: "{{ (cinder_oslomsg_rpc_vhost is string) | ternary(cinder_oslomsg_rpc_vhost, cinder_oslomsg_rpc_vhost | selectattr('state', 'eq', 'present') | map(attribute='name') | first) }}" +_cinder_oslomsg_notify_vhost_conf: "{{ (cinder_oslomsg_notify_vhost is string) | ternary(cinder_oslomsg_notify_vhost, cinder_oslomsg_notify_vhost | selectattr('state', 'eq', 'present') | map(attribute='name') | first) }}" + # # Compile a list of the services on a host based on whether # the host is in the host group and the service is enabled.