From 610564638f35a6609d7d84e3f5a7c7a48ff2e06e Mon Sep 17 00:00:00 2001 From: Denis Egorenko Date: Mon, 16 May 2016 20:54:35 +0300 Subject: [PATCH] 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 --- .../openstack_tasks/manifests/heat/heat.pp | 5 +++-- tests/noop/spec/hosts/heat/heat_spec.rb | 22 +++++++++++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/deployment/puppet/openstack_tasks/manifests/heat/heat.pp b/deployment/puppet/openstack_tasks/manifests/heat/heat.pp index 1fa6a94ef8..09e3a3f850 100644 --- a/deployment/puppet/openstack_tasks/manifests/heat/heat.pp +++ b/deployment/puppet/openstack_tasks/manifests/heat/heat.pp @@ -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, diff --git a/tests/noop/spec/hosts/heat/heat_spec.rb b/tests/noop/spec/hosts/heat/heat_spec.rb index 0b06f83f97..d8f0597c87 100644 --- a/tests/noop/spec/hosts/heat/heat_spec.rb +++ b/tests/noop/spec/hosts/heat/heat_spec.rb @@ -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