From 85d069bbf7836dfb54b9ea5f840cb7705d301e09 Mon Sep 17 00:00:00 2001 From: Andrew Smith Date: Fri, 27 May 2016 09:14:10 -0400 Subject: [PATCH] Add transport_url parameters for oslo.messaging This commit adds the transport_url parameters for oslo.messaging. The url is of the form: transport://user:pass@host1:port[,hostN:portN]/virtual_host Where the transport scheme specifies the rpc or notification backend as one of rabbit, amqp, zmq, etc. Oslo.messaging is deprecating the host, port, and auth configuration options [1]. All drivers will get these options via the transport_url. This patch: * use oslo::messaging::default resource * use oslo::messaging::notifications resource * add parameters for transport_url(s) * update spec tests * add feature release note [1] https://review.openstack.org/#/c/317285/ Change-Id: I42ac4ecb3ce9935dc5403c3b1962ee6a6ff8625b --- manifests/init.pp | 18 +++++++++++++++++- ...nsport_url_parameters-1472d30d4aaa30ba.yaml | 3 +++ spec/classes/heat_init_spec.rb | 5 ++++- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/add_transport_url_parameters-1472d30d4aaa30ba.yaml diff --git a/manifests/init.pp b/manifests/init.pp index 9d5556db..0f2cffde 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -17,6 +17,12 @@ # If set to boolean 'false', it will not log to any directory # Defaults to undef. # +# [*default_transport_url*] +# (optional) A URL representing the messaging driver to use and its full +# configuration. Transport URLs take the form: +# transport://user:pass@host1:port[,hostN:portN]/virtual_host +# Defaults to $::os_service_default +# # [*rpc_backend*] # (Optional) Use these options to configure the message system. # Defaults to $::os_service_default. @@ -185,6 +191,12 @@ # Should be larger than max_template_size. # Defaults to $::os_service_default # +# [*notification_transport_url*] +# (optional) A URL representing the messaging driver to use for notifications +# and its full configuration. Transport URLs take the form: +# transport://user:pass@host1:port[,hostN:portN]/virtual_host +# Defaults to $::os_service_default +# # [*notification_driver*] # (Optional) Driver or drivers to handle sending notifications. # Value can be a string or a list. @@ -324,6 +336,7 @@ class heat( $keystone_project_domain_name = 'Default', $keystone_user_domain_id = 'Default', $keystone_user_domain_name = 'Default', + $default_transport_url = $::os_service_default, $rpc_backend = $::os_service_default, $rpc_response_timeout = $::os_service_default, $rabbit_host = $::os_service_default, @@ -377,6 +390,7 @@ class heat( $sync_db = undef, $max_template_size = $::os_service_default, $max_json_body_size = $::os_service_default, + $notification_transport_url = $::os_service_default, $notification_driver = $::os_service_default, $enable_proxy_headers_parsing = $::os_service_default, $heat_clients_url = $::os_service_default, @@ -502,10 +516,12 @@ class heat( } oslo::messaging::notifications { 'heat_config': - driver => $notification_driver, + transport_url => $notification_transport_url, + driver => $notification_driver, } oslo::messaging::default { 'heat_config': + transport_url => $default_transport_url, rpc_response_timeout => $rpc_response_timeout, } diff --git a/releasenotes/notes/add_transport_url_parameters-1472d30d4aaa30ba.yaml b/releasenotes/notes/add_transport_url_parameters-1472d30d4aaa30ba.yaml new file mode 100644 index 00000000..a7213685 --- /dev/null +++ b/releasenotes/notes/add_transport_url_parameters-1472d30d4aaa30ba.yaml @@ -0,0 +1,3 @@ +--- +features: + - Add oslo.messaging transport_url parameters via puppet-oslo resource \ No newline at end of file diff --git a/spec/classes/heat_init_spec.rb b/spec/classes/heat_init_spec.rb index 9f660eb7..25666dd7 100644 --- a/spec/classes/heat_init_spec.rb +++ b/spec/classes/heat_init_spec.rb @@ -126,6 +126,7 @@ describe 'heat' do it { is_expected.to contain_heat_config('paste_deploy/flavor').with_value('keystone') } it 'configures notification_driver' do + is_expected.to contain_heat_config('oslo_messaging_notifications/transport_url').with_value('') is_expected.to contain_heat_config('oslo_messaging_notifications/driver').with_value('') end @@ -437,11 +438,13 @@ describe 'heat' do shared_examples_for 'with notification_driver set to a string' do before do params.merge!( - :notification_driver => 'bar.foo.rpc_notifier', + :notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673', + :notification_driver => 'bar.foo.rpc_notifier', ) end it 'has notification_driver set when specified' do + is_expected.to contain_heat_config('oslo_messaging_notifications/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673') is_expected.to contain_heat_config('oslo_messaging_notifications/driver').with_value('bar.foo.rpc_notifier') end end