Add service_url parameter for url override

Change-Id: Ib1066441a85c91d071c4136a475c117a122875c4
This commit is contained in:
Rocky 2017-10-12 13:02:18 +11:00
parent bc7db847f3
commit d1adc5f029
3 changed files with 20 additions and 2 deletions

View File

@ -135,6 +135,10 @@
# for murano rabbit server.
# Defaults to $::os_service_default
#
# [*service_url*]
# (Optional) URL for the API service
# Defaults to undef
#
# [*service_host*]
# (Optional) Host for murano to listen on
# Defaults to '127.0.0.1'
@ -318,6 +322,7 @@ class murano(
$rabbit_own_vhost = 'murano',
$rabbit_own_use_ssl = $::os_service_default,
$rabbit_own_ca_certs = $::os_service_default,
$service_url = undef,
$service_host = '127.0.0.1',
$service_port = '8082',
$use_ssl = false,
@ -423,8 +428,15 @@ deprecated. Please use murano::default_transport_url instead.")
}
}
if $service_url {
$url = $service_url
}
else {
$url = "${service_protocol}://${service_host}:${service_port}"
}
murano_config {
'murano/url' : value => "${service_protocol}://${service_host}:${service_port}";
'murano/url' : value => $url;
'engine/use_trusts' : value => $use_trusts;

View File

@ -0,0 +1,5 @@
---
features:
- Add new parameter "service_url" to override the murano-api url setting.
Because when loadbalancer in front of murano-api terminates SSL, the murano
api url should be with https while use_ssl is false.

View File

@ -106,6 +106,7 @@ describe 'murano' do
:rabbit_own_password => 'secrete',
:rabbit_own_vhost => 'murano_vhost',
:rabbit_own_use_ssl => true,
:service_url => 'http://10.255.0.3:8088',
:service_host => '10.255.0.3',
:service_port => '8088',
:packages_service => 'glare',
@ -146,7 +147,7 @@ describe 'murano' do
it { is_expected.to contain_murano_config('oslo_messaging_notifications/topics').with_value('openstack') }
it { is_expected.to contain_murano_config('oslo_messaging_notifications/driver').with_value('messagingv1') }
it { is_expected.to contain_murano_config('murano/url').with_value('https://10.255.0.3:8088') }
it { is_expected.to contain_murano_config('murano/url').with_value('http://10.255.0.3:8088') }
it { is_expected.to contain_murano_config('engine/use_trusts').with_value(true) }