Merge "add more heat.conf settings to heat, engine classes" into stable/liberty

This commit is contained in:
Jenkins 2016-03-09 16:58:17 +00:00 committed by Gerrit Code Review
commit 536651fe8a
4 changed files with 118 additions and 51 deletions

View File

@ -77,20 +77,35 @@
# configure the keystone roles.
# Defaults to ['heat_stack_owner']
#
# [*instance_connection_is_secure*]
# (Optional) Instance connection to CFN/CW API via https.
# Defaults to '0'
#
# [*instance_connection_https_validate_certificates*]
# (Optional) Instance connection to CFN/CW API validate certs if SSL is used.
# Defaults to '1'
#
# [*max_resources_per_stack*]
# (Optional) Maximum resources allowed per top-level stack.
# Defaults to '1000'
#
class heat::engine (
$auth_encryption_key,
$package_ensure = 'present',
$manage_service = true,
$enabled = true,
$heat_stack_user_role = 'heat_stack_user',
$heat_metadata_server_url = 'http://127.0.0.1:8000',
$heat_waitcondition_server_url = 'http://127.0.0.1:8000/v1/waitcondition',
$heat_watch_server_url = 'http://127.0.0.1:8003',
$engine_life_check_timeout = '2',
$deferred_auth_method = 'trusts',
$default_software_config_transport = 'POLL_SERVER_CFN',
$default_deployment_signal_transport = 'CFN_SIGNAL',
$trusts_delegated_roles = ['heat_stack_owner'],
$package_ensure = 'present',
$manage_service = true,
$enabled = true,
$heat_stack_user_role = 'heat_stack_user',
$heat_metadata_server_url = 'http://127.0.0.1:8000',
$heat_waitcondition_server_url = 'http://127.0.0.1:8000/v1/waitcondition',
$heat_watch_server_url = 'http://127.0.0.1:8003',
$engine_life_check_timeout = '2',
$deferred_auth_method = 'trusts',
$default_software_config_transport = 'POLL_SERVER_CFN',
$default_deployment_signal_transport = 'CFN_SIGNAL',
$trusts_delegated_roles = ['heat_stack_owner'],
$instance_connection_is_secure = '0',
$instance_connection_https_validate_certificates = '1',
$max_resources_per_stack = '1000',
) {
include ::heat::deps
@ -131,15 +146,18 @@ class heat::engine (
}
heat_config {
'DEFAULT/auth_encryption_key' : value => $auth_encryption_key;
'DEFAULT/heat_stack_user_role' : value => $heat_stack_user_role;
'DEFAULT/heat_metadata_server_url' : value => $heat_metadata_server_url;
'DEFAULT/heat_waitcondition_server_url' : value => $heat_waitcondition_server_url;
'DEFAULT/heat_watch_server_url' : value => $heat_watch_server_url;
'DEFAULT/engine_life_check_timeout' : value => $engine_life_check_timeout;
'DEFAULT/default_software_config_transport' : value => $default_software_config_transport;
'DEFAULT/default_deployment_signal_transport' : value => $default_deployment_signal_transport;
'DEFAULT/trusts_delegated_roles' : value => $trusts_delegated_roles;
'DEFAULT/deferred_auth_method' : value => $deferred_auth_method;
'DEFAULT/auth_encryption_key': value => $auth_encryption_key;
'DEFAULT/heat_stack_user_role': value => $heat_stack_user_role;
'DEFAULT/heat_metadata_server_url': value => $heat_metadata_server_url;
'DEFAULT/heat_waitcondition_server_url': value => $heat_waitcondition_server_url;
'DEFAULT/heat_watch_server_url': value => $heat_watch_server_url;
'DEFAULT/engine_life_check_timeout': value => $engine_life_check_timeout;
'DEFAULT/default_software_config_transport': value => $default_software_config_transport;
'DEFAULT/default_deployment_signal_transport': value => $default_deployment_signal_transport;
'DEFAULT/trusts_delegated_roles': value => $trusts_delegated_roles;
'DEFAULT/deferred_auth_method': value => $deferred_auth_method;
'DEFAULT/max_resources_per_stack': value => $max_resources_per_stack;
'DEFAULT/instance_connection_https_validate_certificates': value => $instance_connection_https_validate_certificates;
'DEFAULT/instance_connection_is_secure': value => $instance_connection_is_secure;
}
}

View File

@ -99,6 +99,20 @@
# (Optional) Use durable queues in amqp.
# Defaults to false
#
# [*max_template_size*]
# (Optional) Maximum raw byte size of any template.
# Defaults to '524288'
#
# [*max_json_body_size*]
# (Optional) Maximum raw byte size of JSON request body.
# Should be larger than max_template_size.
# Defaults to '1048576'
#
# [*notification_driver*]
# (Optional) Driver or drivers to handle sending notifications.
# Value can be a string or a list.
# Defaults to messagingv2
#
# == keystone authentication options
#
# [*auth_uri*]
@ -293,6 +307,9 @@ class heat(
$enable_stack_adopt = undef,
$enable_stack_abandon = undef,
$sync_db = undef,
$max_template_size = '524288',
$max_json_body_size = '1048576',
$notification_driver = 'messagingv2',
# Deprecated parameters
$mysql_module = undef,
$sql_connection = undef,
@ -484,12 +501,15 @@ class heat(
}
heat_config {
'DEFAULT/rpc_backend' : value => $rpc_backend;
'DEFAULT/rpc_response_timeout' : value => $rpc_response_timeout;
'ec2authtoken/auth_uri' : value => $keystone_ec2_uri;
'keystone_authtoken/admin_tenant_name' : value => $keystone_tenant;
'keystone_authtoken/admin_user' : value => $keystone_user;
'keystone_authtoken/admin_password' : value => $keystone_password, secret => true;
'DEFAULT/rpc_backend': value => $rpc_backend;
'DEFAULT/rpc_response_timeout': value => $rpc_response_timeout;
'DEFAULT/max_template_size': value => $max_template_size;
'DEFAULT/max_json_body_size': value => $max_json_body_size;
'DEFAULT/notification_driver': value => $notification_driver;
'ec2authtoken/auth_uri': value => $keystone_ec2_uri;
'keystone_authtoken/admin_tenant_name': value => $keystone_tenant;
'keystone_authtoken/admin_user': value => $keystone_user;
'keystone_authtoken/admin_password': value => $keystone_password, secret => true;
}
if $flavor {

View File

@ -3,35 +3,41 @@ require 'spec_helper'
describe 'heat::engine' do
let :default_params do
{ :enabled => true,
:manage_service => true,
:heat_stack_user_role => 'heat_stack_user',
:heat_metadata_server_url => 'http://127.0.0.1:8000',
:heat_waitcondition_server_url => 'http://127.0.0.1:8000/v1/waitcondition',
:heat_watch_server_url => 'http://128.0.0.1:8003',
:engine_life_check_timeout => '2',
:trusts_delegated_roles => ['heat_stack_owner'],
:deferred_auth_method => 'trusts',
:default_software_config_transport => 'POLL_SERVER_CFN',
:default_deployment_signal_transport => 'CFN_SIGNAL',
{ :enabled => true,
:manage_service => true,
:heat_stack_user_role => 'heat_stack_user',
:heat_metadata_server_url => 'http://127.0.0.1:8000',
:heat_waitcondition_server_url => 'http://127.0.0.1:8000/v1/waitcondition',
:heat_watch_server_url => 'http://128.0.0.1:8003',
:engine_life_check_timeout => '2',
:trusts_delegated_roles => ['heat_stack_owner'],
:deferred_auth_method => 'trusts',
:default_software_config_transport => 'POLL_SERVER_CFN',
:default_deployment_signal_transport => 'CFN_SIGNAL',
:max_resources_per_stack => '1000',
:instance_connection_is_secure => '0',
:instance_connection_https_validate_certificates => '1,'
}
end
shared_examples_for 'heat-engine' do
[
{},
{ :auth_encryption_key => '1234567890AZERTYUIOPMLKJHGFDSQ12' },
{ :auth_encryption_key => '0234567890AZERTYUIOPMLKJHGFDSQ24',
:enabled => false,
:heat_stack_user_role => 'heat_stack_user',
:heat_metadata_server_url => 'http://127.0.0.1:8000',
:heat_waitcondition_server_url => 'http://127.0.0.1:8000/v1/waitcondition',
:heat_watch_server_url => 'http://128.0.0.1:8003',
:engine_life_check_timeout => '2',
:trusts_delegated_roles => ['role1', 'role2'],
:deferred_auth_method => 'trusts',
:default_software_config_transport => 'POLL_SERVER_CFN',
:default_deployment_signal_transport => 'CFN_SIGNAL',
{ :auth_encryption_key => '1234567890AZERTYUIOPMLKJHGFDSQ12' },
{ :auth_encryption_key => '0234567890AZERTYUIOPMLKJHGFDSQ24',
:enabled => false,
:heat_stack_user_role => 'heat_stack_user',
:heat_metadata_server_url => 'http://127.0.0.1:8000',
:heat_waitcondition_server_url => 'http://127.0.0.1:8000/v1/waitcondition',
:heat_watch_server_url => 'http://128.0.0.1:8003',
:engine_life_check_timeout => '2',
:trusts_delegated_roles => ['role1', 'role2'],
:deferred_auth_method => 'trusts',
:default_software_config_transport => 'POLL_SERVER_CFN',
:default_deployment_signal_transport => 'CFN_SIGNAL',
:max_resources_per_stack => '2000',
:instance_connection_is_secure => '1',
:instance_connection_https_validate_certificates => '0,'
}
].each do |new_params|
describe 'when #{param_set == {} ? "using default" : "specifying"} parameters'
@ -69,6 +75,9 @@ describe 'heat::engine' do
it { is_expected.to contain_heat_config('DEFAULT/deferred_auth_method').with_value( expected_params[:deferred_auth_method] ) }
it { is_expected.to contain_heat_config('DEFAULT/default_software_config_transport').with_value( expected_params[:default_software_config_transport] ) }
it { is_expected.to contain_heat_config('DEFAULT/default_deployment_signal_transport').with_value( expected_params[:default_deployment_signal_transport] ) }
it { is_expected.to contain_heat_config('DEFAULT/instance_connection_is_secure').with_value( expected_params[:instance_connection_is_secure] ) }
it { is_expected.to contain_heat_config('DEFAULT/instance_connection_https_validate_certificates').with_value( expected_params[:instance_connection_https_validate_certificates] ) }
it { is_expected.to contain_heat_config('DEFAULT/max_resources_per_stack').with_value( expected_params[:max_resources_per_stack] ) }
end
context 'with disabled service managing' do

View File

@ -78,6 +78,7 @@ describe 'heat' do
it_configures "with custom keystone identity_uri"
it_configures "with custom keystone identity_uri and auth_uri"
it_configures 'with enable_stack_adopt and enable_stack_abandon set'
it_configures 'with notification_driver set to a string'
end
shared_examples_for 'a heat base installation' do
@ -111,6 +112,13 @@ describe 'heat' do
is_expected.to contain_heat_config('keystone_authtoken/admin_password').with_secret(true)
end
it 'configures max_json_body_size' do
is_expected.to contain_heat_config('DEFAULT/max_json_body_size').with_value('1048576')
end
it 'configures max_template_size' do
is_expected.to contain_heat_config('DEFAULT/max_template_size').with_value('524288')
end
end
@ -426,6 +434,18 @@ describe 'heat' do
end
end
shared_examples_for 'with notification_driver set to a string' do
before do
params.merge!(
:notification_driver => 'bar.foo.rpc_notifier',
)
end
it 'has notification_driver set when specified' do
is_expected.to contain_heat_config('DEFAULT/notification_driver').with_value('bar.foo.rpc_notifier')
end
end
context 'on Debian platforms' do
let :facts do
@default_facts.merge({