Add support for convergence_engine option

This is a boolean which enables the "new" heat convergence architecture.

Heat plans to make this enabled by default soon (currently disabled), so
adding this will provide an easy way for deployers to maintain the old
architecture if they wish.

Change-Id: I4e879751a30c961e851ab9da80612d3f2fb2395a
This commit is contained in:
Steven Hardy 2016-05-25 16:33:04 +01:00 committed by Emilien Macchi
parent 90477ae87d
commit 5b9adc6937
2 changed files with 29 additions and 20 deletions

View File

@ -93,6 +93,10 @@
# (Optional) The number of workers to spawn. # (Optional) The number of workers to spawn.
# Defaults to $::os_service_default. # Defaults to $::os_service_default.
# #
# [*convergence_engine*]
# (Optional) Enables engine with convergence architecture.
# Defaults to $::os_service_default.
#
class heat::engine ( class heat::engine (
$auth_encryption_key, $auth_encryption_key,
$package_ensure = 'present', $package_ensure = 'present',
@ -111,6 +115,7 @@ class heat::engine (
$instance_connection_https_validate_certificates = $::os_service_default, $instance_connection_https_validate_certificates = $::os_service_default,
$max_resources_per_stack = $::os_service_default, $max_resources_per_stack = $::os_service_default,
$num_engine_workers = $::os_service_default, $num_engine_workers = $::os_service_default,
$convergence_engine = $::os_service_default,
) { ) {
include ::heat::deps include ::heat::deps
@ -165,5 +170,6 @@ class heat::engine (
'DEFAULT/instance_connection_https_validate_certificates': value => $instance_connection_https_validate_certificates; 'DEFAULT/instance_connection_https_validate_certificates': value => $instance_connection_https_validate_certificates;
'DEFAULT/instance_connection_is_secure': value => $instance_connection_is_secure; 'DEFAULT/instance_connection_is_secure': value => $instance_connection_is_secure;
'DEFAULT/num_engine_workers': value => $num_engine_workers; 'DEFAULT/num_engine_workers': value => $num_engine_workers;
'DEFAULT/convergence_engine': value => $convergence_engine;
} }
} }

View File

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