diff --git a/manifests/init.pp b/manifests/init.pp index b305dbb..6a08359 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -92,6 +92,12 @@ # transport://user:pass@host1:port[,hostN:portN]/virtual_host # 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 +# # [*rabbit_ha_queues*] # (optional) Use HA queues in RabbitMQ (x-ha-policy: all). # Defaults to $::os_service_default @@ -218,6 +224,7 @@ class mistral( $control_exchange = $::os_service_default, $rpc_response_timeout = $::os_service_default, $default_transport_url = $::os_service_default, + $notification_transport_url = $::os_service_default, $rabbit_ha_queues = $::os_service_default, $rabbit_heartbeat_timeout_threshold = $::os_service_default, $rabbit_heartbeat_rate = $::os_service_default, @@ -295,6 +302,10 @@ deprecated. Please use mistral::default_transport_url instead.") rpc_response_timeout => $rpc_response_timeout, } + oslo::messaging::notifications {'mistral_config': + transport_url => $notification_transport_url, + } + if $rpc_backend in [$::os_service_default, 'rabbit'] { oslo::messaging::rabbit {'mistral_config': diff --git a/releasenotes/notes/add-notification-transport-url-5a3e7f6d1630d14b.yaml b/releasenotes/notes/add-notification-transport-url-5a3e7f6d1630d14b.yaml new file mode 100644 index 0000000..df09cf8 --- /dev/null +++ b/releasenotes/notes/add-notification-transport-url-5a3e7f6d1630d14b.yaml @@ -0,0 +1,4 @@ +--- +features: + - Add olso.messaging notification transport_url via puppet-olso + resource. diff --git a/spec/classes/mistral_init_spec.rb b/spec/classes/mistral_init_spec.rb index 8eee9a1..bf2d0f5 100644 --- a/spec/classes/mistral_init_spec.rb +++ b/spec/classes/mistral_init_spec.rb @@ -37,6 +37,8 @@ describe 'mistral' do is_expected.to contain_mistral_config('DEFAULT/rpc_response_timeout').with(:value => '') is_expected.to contain_mistral_config('DEFAULT/report_interval').with(:value => '') is_expected.to contain_mistral_config('DEFAULT/service_down_time').with(:value => '') + is_expected.to contain_mistral_config('DEFAULT/transport_url').with(:value => '') + is_expected.to contain_mistral_config('oslo_messaging_notifications/transport_url').with(:value => '') is_expected.to contain_mistral_config('oslo_messaging_rabbit/rabbit_password').with(:value => '', :secret => true) is_expected.to contain_mistral_config('oslo_messaging_rabbit/rabbit_host').with(:value => '') is_expected.to contain_mistral_config('oslo_messaging_rabbit/rabbit_port').with(:value => '') @@ -106,7 +108,7 @@ describe 'mistral' do end end - describe 'with rabbit transport url configured' do + describe 'with rabbit default transport url configured' do let :params do req_params.merge({'default_transport_url' => 'rabbit://user:pass@host:1234/virt' }) end @@ -116,6 +118,16 @@ describe 'mistral' do end end + describe 'with rabbit notification transport url configured' do + let :params do + req_params.merge({'notification_transport_url' => 'rabbit://user:pass@host:1234/virt' }) + end + + it 'should contain transport_url' do + is_expected.to contain_mistral_config('oslo_messaging_notifications/transport_url').with(:value => 'rabbit://user:pass@host:1234/virt') + end + end + describe 'with rabbitmq heartbeats' do let :params do req_params.merge({'rabbit_heartbeat_timeout_threshold' => '60', 'rabbit_heartbeat_rate' => '10'})