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: #1576520
Related-bug: #1582283
(cherry picked from commit 610564638f)
This commit is contained in:
Denis Egorenko 2016-05-16 20:54:35 +03:00 committed by Dmitry Kaigarodsev
parent fbfa950eff
commit 5449a63af1
2 changed files with 31 additions and 6 deletions

View File

@ -22,14 +22,17 @@ $internal_auth_address = get_ssl_property($ssl_hash, {}, 'keystone', 'interna
$admin_auth_protocol = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'protocol', 'http')
$admin_auth_address = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'hostname', [$service_endpoint, $management_vip])
$heat_protocol = get_ssl_property($ssl_hash, {}, 'heat', 'internal', 'protocol', 'http')
$heat_endpoint = get_ssl_property($ssl_hash, {}, 'heat', 'internal', 'hostname', [hiera('heat_endpoint', ''), $management_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', ''), $management_vip])
$internal_ssl = get_ssl_property($ssl_hash, {}, 'heat', 'internal', 'usage', false)
$public_ssl = get_ssl_property($ssl_hash, {}, 'heat', 'public', 'usage', false)
$auth_uri = "${public_auth_protocol}://${public_auth_address}:5000/v2.0/"
$identity_uri = "${admin_auth_protocol}://${admin_auth_address}:35357/"
$auth_uri = "${public_auth_protocol}://${public_auth_address}:5000/v2.0/"
$identity_uri = "${admin_auth_protocol}://${admin_auth_address}:35357/"
$api_bind_port = '8004'
$heat_clients_url = "${heat_protocol}://${public_vip}:${api_bind_port}/v1/%(tenant_id)s"
$debug = pick($heat_hash['debug'], hiera('debug', false))
$verbose = pick($heat_hash['verbose'], hiera('verbose', true))
@ -73,7 +76,7 @@ if $::operatingsystem == 'Ubuntu' {
}
class { 'openstack::heat' :
external_ip => $management_vip,
external_ip => $heat_endpoint,
keystone_auth => pick($heat_hash['keystone_auth'], true),
api_bind_host => $bind_address,
api_cfn_bind_host => $bind_address,
@ -128,6 +131,11 @@ heat_config {
'cache/memcache_servers': value => "${memcache_address}:11211";
}
# Set heat_clients_url
heat_config {
'clients_heat/url': value => $heat_clients_url;
}
#------------------------------
class heat::docker_resource (

View File

@ -18,19 +18,26 @@ describe manifest do
Noop.puppet_function 'get_network_role_property', 'mgmt/memcache', 'ipaddr'
end
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'
@ -85,6 +92,16 @@ describe manifest do
should contain_heat_config('cache/memcache_servers').with_value("#{memcache_address}:11211")
end
it 'should configure clients URL' do
should contain_heat_config('clients_heat/url').with_value("#{public_heat_protocol}://#{public_vip}:8004/v1/%(tenant_id)s")
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