From 3bbc52b399d0aaf2874a7f88806f94f2514e2aa3 Mon Sep 17 00:00:00 2001 From: ZhijunWei Date: Wed, 19 Sep 2018 08:20:41 -0400 Subject: [PATCH] Update messaging notification configuration This patch add the conditional inclusion of the notification section of the service configuration. This ensures that oslo.messaging notifications use the correct transport for deployments that have separate rpc and notify messaging backends. For example, if the transport_url is not provided in the notification section of the service configuration, the transport_url specified in the default section will be used instead. This patch conditionally selects the notifier driver. The noop driver will be selected when notification publishing is disabled. The messagingv2 driver is selected when notification publishing is enabled. Change-Id: Ie967b281e15127bbf611aca557e99ac6b3d1cd4b Closes-Bug: #1794320 --- defaults/main.yml | 3 +++ templates/trove-conductor.conf.j2 | 1 + templates/trove-guestagent.conf.j2 | 1 + templates/trove.conf.j2 | 1 + 4 files changed, 6 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index ea2dec0..5ca4385 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -74,6 +74,9 @@ trove_api_workers: "{{ [[ansible_processor_vcpus|default(2) // 2, 1] | max, trov trove_conductor_workers_max: 16 trove_conductor_workers: "{{ [[ansible_processor_vcpus|default(2) // 2, 1] | max, trove_conductor_workers_max] | min }}" +# Enable/Disable Ceilometer +trove_ceilometer_enabled: False + # TODO(odyssey4me): # This can be simplified once all the roles are using # python_venv_build. We can then switch to using a diff --git a/templates/trove-conductor.conf.j2 b/templates/trove-conductor.conf.j2 index 600059f..172cb6b 100644 --- a/templates/trove-conductor.conf.j2 +++ b/templates/trove-conductor.conf.j2 @@ -24,4 +24,5 @@ connection = "{{ trove_galera_connection_string }}" ssl={{ trove_oslomsg_rpc_use_ssl }} [oslo_messaging_notifications] +driver = {% if trove_ceilometer_enabled %}messagingv2{% else %}noop{% endif %} transport_url = {{ trove_oslomsg_notify_transport }}://{% for host in trove_oslomsg_notify_servers.split(',') %}{{ trove_oslomsg_notify_userid }}:{{ trove_oslomsg_notify_password }}@{{ host }}:{{ trove_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ trove_oslomsg_notify_vhost }}{% endif %}{% endfor %} diff --git a/templates/trove-guestagent.conf.j2 b/templates/trove-guestagent.conf.j2 index 9393f17..a8f2cdf 100644 --- a/templates/trove-guestagent.conf.j2 +++ b/templates/trove-guestagent.conf.j2 @@ -59,6 +59,7 @@ log_file = trove-guestagent.log ssl = {{ trove_guest_oslomsg_rpc_use_ssl }} [oslo_messaging_notifications] +driver = {% if trove_ceilometer_enabled %}messagingv2{% else %}noop{% endif %} transport_url = {{ trove_oslomsg_notify_transport }}://{% for host in trove_oslomsg_notify_servers.split(',') %}{{ trove_oslomsg_notify_userid }}:{{ trove_oslomsg_notify_password }}@{{ host }}:{{ trove_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ trove_oslomsg_notify_vhost }}{% endif %}{% endfor %} # ========== Datastore Specific Configuration Options ========== diff --git a/templates/trove.conf.j2 b/templates/trove.conf.j2 index cbb4f31..90a81e0 100644 --- a/templates/trove.conf.j2 +++ b/templates/trove.conf.j2 @@ -119,6 +119,7 @@ enabled = {{ trove_profiler_enabled }} ssl = {{ trove_oslomsg_rpc_use_ssl }} [oslo_messaging_notifications] +driver = {% if trove_ceilometer_enabled %}messagingv2{% else %}noop{% endif %} transport_url = {{ trove_oslomsg_notify_transport }}://{% for host in trove_oslomsg_notify_servers.split(',') %}{{ trove_oslomsg_notify_userid }}:{{ trove_oslomsg_notify_password }}@{{ host }}:{{ trove_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ trove_oslomsg_notify_vhost }}{% endif %}{% endfor %} {% include 'include_db.j2' %}