diff --git a/manifests/dashboards/heat.pp b/manifests/dashboards/heat.pp index 5de7b8b4..bfd5456a 100644 --- a/manifests/dashboards/heat.pp +++ b/manifests/dashboards/heat.pp @@ -25,9 +25,19 @@ # (optional) Local copy of service policy files. # Defaults to 'heat_policy.yaml' # +# [*template_generator_api_timeout*] +# (optional) API timeout to retrieve response from template generator. +# Defaults to 60 +# +# [*template_generator_api_parallel*] +# (optional) Concurrency to retrieve response from template generator. +# Defualts to 2 +# class horizon::dashboards::heat( - $enable_user_pass = true, - $policy_file = 'heat_policy.yaml', + $enable_user_pass = true, + $policy_file = 'heat_policy.yaml', + $template_generator_api_timeout = 60, + $template_generator_api_parallel = 2, ) { include horizon::deps diff --git a/releasenotes/notes/heat_template_generator-bc485a59c5e63b62.yaml b/releasenotes/notes/heat_template_generator-bc485a59c5e63b62.yaml new file mode 100644 index 00000000..626fce13 --- /dev/null +++ b/releasenotes/notes/heat_template_generator-bc485a59c5e63b62.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + The ``heat::dashboards::heat`` class now supports the following two + parameters. + + - ``template_generator_api_timeout`` + - ``template_generator_api_parallel`` diff --git a/spec/classes/horizon_dashboards_heat_spec.rb b/spec/classes/horizon_dashboards_heat_spec.rb index f13b1114..558c4607 100644 --- a/spec/classes/horizon_dashboards_heat_spec.rb +++ b/spec/classes/horizon_dashboards_heat_spec.rb @@ -16,7 +16,6 @@ describe 'horizon::dashboards::heat' do } eos end - it 'installs heat-dashboard package' do is_expected.to contain_package('heat-dashboard').with( :ensure => 'present', @@ -36,6 +35,12 @@ eos " 'enable_user_pass': True,", "}", ]) + verify_concat_fragment_contents(catalogue, '_1699_orchestration_settings.py', [ + "HEAT_TEMPLATE_GENERATOR_API_TIMEOUT = 60" + ]) + verify_concat_fragment_contents(catalogue, '_1699_orchestration_settings.py', [ + "HEAT_TEMPLATE_GENERATOR_API_PARALLEL = 2" + ]) end end @@ -47,18 +52,40 @@ eos } eos end - before do params.merge!({ :enable_user_pass => false }) end - - it { + it 'generates _1699_orchestration_settings.py' do verify_concat_fragment_contents(catalogue, '_1699_orchestration_settings.py', [ "OPENSTACK_HEAT_STACK = {", " 'enable_user_pass': False,", "}", ]) - } + end + end + + context 'with template_generator parameters set' do + let(:pre_condition) do + <<-eos + class { 'horizon': + secret_key => 'elj1IWiLoWHgcyYxFVLj7cM5rGOOxWl0', + } +eos + end + before do + params.merge!({ + :template_generator_api_timeout => 120, + :template_generator_api_parallel => 4, + }) + end + it 'generates _1699_orchestration_settings.py' do + verify_concat_fragment_contents(catalogue, '_1699_orchestration_settings.py', [ + "HEAT_TEMPLATE_GENERATOR_API_TIMEOUT = 120" + ]) + verify_concat_fragment_contents(catalogue, '_1699_orchestration_settings.py', [ + "HEAT_TEMPLATE_GENERATOR_API_PARALLEL = 4" + ]) + end end context 'without the horizon class defined' do diff --git a/templates/_1699_orchestration_settings.py.erb b/templates/_1699_orchestration_settings.py.erb index f449a375..6c44ce49 100644 --- a/templates/_1699_orchestration_settings.py.erb +++ b/templates/_1699_orchestration_settings.py.erb @@ -32,7 +32,7 @@ settings.LOGGING['loggers'].update({ }) # Template Generator retrieve options API TIMEOUT -HEAT_TEMPLATE_GENERATOR_API_TIMEOUT = 60 +HEAT_TEMPLATE_GENERATOR_API_TIMEOUT = <%= @template_generator_api_timeout.to_s %> # Template Generator retrieve options API PARALLEL LEVEL -HEAT_TEMPLATE_GENERATOR_API_PARALLEL = 2 +HEAT_TEMPLATE_GENERATOR_API_PARALLEL = <%= @template_generator_api_parallel.to_s %>