From 7bb3cd07bf370cf58964afb9e51d8420cfadfd29 Mon Sep 17 00:00:00 2001 From: Travis Truman Date: Thu, 21 Jul 2016 09:39:21 -0400 Subject: [PATCH] Allow configuration of multiple rabbit clusters Introduced new variables so the transport_url values used for RPC and notifications can vary. By default they will remain the same. Change-Id: I846e39d4a9fbae060644c51e4d0c0b07c59d583b Implements: blueprint multi-rabbitmq-clusters --- defaults/main.yml | 9 +++++++++ templates/keystone.conf.j2 | 21 +++++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 5579f486..e00a4874 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -93,6 +93,8 @@ keystone_database_max_pool_size: 120 keystone_database_pool_timeout: 30 ## RabbitMQ info + +## Configuration for RPC communications keystone_messaging_enabled: true keystone_rabbitmq_port: 5671 keystone_rabbitmq_userid: keystone @@ -100,6 +102,13 @@ keystone_rabbitmq_vhost: /keystone keystone_rabbitmq_servers: localhost keystone_rabbitmq_use_ssl: false +## Configuration for notifications communication, i.e. [oslo_messaging_notifications] +keystone_rabbitmq_telemetry_userid: "{{ keystone_rabbitmq_userid }}" +keystone_rabbitmq_telemetry_vhost: "{{ keystone_rabbitmq_vhost }}" +keystone_rabbitmq_telemetry_port: "{{ keystone_rabbitmq_port }}" +keystone_rabbitmq_telemetry_servers: "{{ keystone_rabbitmq_servers }}" +keystone_rabbitmq_telemetry_use_ssl: "{{ keystone_rabbitmq_use_ssl }}" + ## Role info keystone_role_name: admin keystone_default_role_name: _member_ diff --git a/templates/keystone.conf.j2 b/templates/keystone.conf.j2 index 614f2458..f8ae4f38 100644 --- a/templates/keystone.conf.j2 +++ b/templates/keystone.conf.j2 @@ -15,10 +15,19 @@ secure_proxy_ssl_header = {{ keystone_secure_proxy_ssl_header }} log_file = keystone.log log_dir = /var/log/keystone + +## RabbitMQ RPC +{% if keystone_messaging_enabled | bool %} rpc_backend = {{ keystone_rpc_backend }} +transport_url = rabbit://{% for host in keystone_rabbitmq_servers.split(',') %}{{ keystone_rabbitmq_userid }}:{{ keystone_rabbitmq_password }}@{{ host }}:{{ keystone_rabbitmq_port }}/{{ keystone_rabbitmq_vhost }}?rabbit_use_ssl={{ keystone_rabbitmq_use_ssl }},{% endfor %} + +[oslo_messaging_rabbit] +{% endif %} {% if keystone_ceilometer_enabled %} -notification_driver = messagingv2 +[oslo_messaging_notifications] +driver = messagingv2 +transport_url = rabbit://{% for host in keystone_rabbitmq_telemetry_servers.split(',') %}{{ keystone_rabbitmq_telemetry_userid }}:{{ keystone_rabbitmq_telemetry_password }}@{{ host }}:{{ keystone_rabbitmq_telemetry_port }}/{{ keystone_rabbitmq_telemetry_vhost }}?rabbit_use_ssl={{ keystone_rabbitmq_telemetry_use_ssl }},{% endfor %} {% endif %} {% if 'memcache' in keystone_token_driver and 'fernet' not in keystone_token_provider %} @@ -147,15 +156,7 @@ admin_bind_host = {{ keystone_bind_address }} admin_port = {{ keystone_admin_port }} public_port = {{ keystone_service_port }} -{% if keystone_messaging_enabled | bool %} -[oslo_messaging_rabbit] -rabbit_port = {{ keystone_rabbitmq_port }} -rabbit_userid = {{ keystone_rabbitmq_userid }} -rabbit_password = {{ keystone_rabbitmq_password }} -rabbit_virtual_host = {{ keystone_rabbitmq_vhost }} -rabbit_hosts = {{ keystone_rabbitmq_servers }} -rabbit_use_ssl = {{ keystone_rabbitmq_use_ssl }} -{% endif %} + {% if keystone_sp != {} %} [federation]