Use public_hash for determining current protocol and address for Heat

Heat parameters heat_metadata_server_url, heat_waitcondition_server_url,
heat_watch_server_url require to be set with proper protocol and address
in case of usage SSL.

Change-Id: I7baa7b44db4237347ddadccb4537e0080ef62322
Closes-bug: #1582283
This commit is contained in:
Denis Egorenko 2016-05-16 20:54:35 +03:00
parent 8bb8d821a0
commit 610564638f
2 changed files with 21 additions and 6 deletions

View File

@ -26,8 +26,8 @@ class openstack_tasks::heat::heat {
$admin_auth_protocol = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'protocol', 'http')
$admin_auth_address = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'hostname', [$keystone_host, $management_vip])
$heat_protocol = get_ssl_property($ssl_hash, {}, 'heat', 'public', 'protocol', 'http')
$heat_endpoint = get_ssl_property($ssl_hash, {}, 'heat', 'public', 'hostname', [hiera('heat_endpoint', ''), $public_vip])
$heat_protocol = get_ssl_property($ssl_hash, $public_ssl_hash, 'heat', 'public', 'protocol', 'http')
$heat_endpoint = get_ssl_property($ssl_hash, $public_ssl_hash, 'heat', 'public', 'hostname', [hiera('heat_endpoint', ''), $public_vip])
$public_ssl = get_ssl_property($ssl_hash, {}, 'heat', 'public', 'usage', false)
$auth_uri = "${public_auth_protocol}://${public_auth_address}:5000/v2.0/"
@ -218,6 +218,7 @@ class openstack_tasks::heat::heat {
max_template_size => '5440000',
max_json_body_size => '10880000',
notification_driver => $ceilometer_hash['notification_driver'],
heat_clients_url => "${heat_protocol}://${public_vip}:${api_bind_port}/v1/%(tenant_id)s",
database_max_pool_size => $max_pool_size,
database_max_overflow => $max_overflow,

View File

@ -39,19 +39,26 @@ describe manifest do
let(:ceilometer_hash) { Noop.hiera_structure 'ceilometer' }
public_vip = Noop.hiera('public_vip')
admin_auth_protocol = 'http'
admin_auth_address = Noop.hiera('service_endpoint')
if Noop.hiera_structure('use_ssl', false)
public_auth_protocol = 'https'
public_auth_address = Noop.hiera_structure('use_ssl/keystone_public_hostname')
public_heat_protocol = 'https'
public_heat_address = Noop.hiera_structure('use_ssl/heat_public_hostname')
admin_auth_protocol = 'https'
admin_auth_address = Noop.hiera_structure('use_ssl/keystone_admin_hostname')
elsif Noop.hiera_structure('public_ssl/services')
public_auth_protocol = 'https'
public_auth_address = Noop.hiera_structure('public_ssl/hostname')
public_heat_protocol = 'https'
public_heat_address = Noop.hiera_structure('public_ssl/hostname')
else
public_auth_protocol = 'http'
public_auth_address = Noop.hiera('public_vip')
public_heat_protocol = 'http'
public_auth_address = public_vip
public_heat_address = public_vip
end
use_syslog = Noop.hiera 'use_syslog'
@ -109,9 +116,10 @@ describe manifest do
it 'should use auth_uri and identity_uri' do
should contain_class('heat').with(
'auth_uri' => "#{public_auth_protocol}://#{public_auth_address}:5000/v2.0/",
'identity_uri' => "#{admin_auth_protocol}://#{admin_auth_address}:35357/",
'sync_db' => primary_controller,
'auth_uri' => "#{public_auth_protocol}://#{public_auth_address}:5000/v2.0/",
'identity_uri' => "#{admin_auth_protocol}://#{admin_auth_address}:35357/",
'sync_db' => primary_controller,
'heat_clients_url' => "#{public_heat_protocol}://#{public_vip}:8004/v1/%(tenant_id)s",
)
end
@ -136,6 +144,12 @@ describe manifest do
should contain_heat_config('cache/memcache_servers').with_value("#{memcache_address}:11211")
end
it 'should configure urls for metadata, cloudwatch and waitcondition servers' do
should contain_heat_config('DEFAULT/heat_metadata_server_url').with_value("#{public_heat_protocol}://#{public_heat_address}:8000")
should contain_heat_config('DEFAULT/heat_waitcondition_server_url').with_value("#{public_heat_protocol}://#{public_heat_address}:8000/v1/waitcondition")
should contain_heat_config('DEFAULT/heat_watch_server_url').with_value("#{public_heat_protocol}://#{public_heat_address}:8003")
end
it 'should configure heat rpc response timeout' do
should contain_heat_config('DEFAULT/rpc_response_timeout').with_value('600')
end