Horizon: Enable heat-dashboard configurations

Depends-on: https://review.opendev.org/802202
Change-Id: I05f9a8e4332be9bea2c623202c01b1c133045852
(cherry picked from commit a194d72785)
(cherry picked from commit ac8482e966)
(cherry picked from commit e61d0d1b06)
This commit is contained in:
Takashi Kajinami 2021-05-04 00:12:04 +09:00
parent 8cfa8bea3d
commit f39d49bdcf
2 changed files with 28 additions and 0 deletions

View File

@ -62,6 +62,10 @@
# (Optional) Array of ipv4 or ipv6 addresses for memcache.
# Defaults to undef
#
# [*heat_api_enabled*]
# (Optional) Indicate whether Heat is available in the deployment.
# Defaults to hiera('heat_api_enabled') or false
#
class tripleo::profile::base::horizon (
$step = Integer(hiera('step')),
$bootstrap_node = hiera('horizon_short_bootstrap_node_name', undef),
@ -70,6 +74,7 @@ class tripleo::profile::base::horizon (
$horizon_network = hiera('horizon_network', undef),
$neutron_options = hiera('horizon::neutron_options', {}),
$memcached_hosts = hiera('memcached_node_names', []),
$heat_api_enabled = hiera('heat_api_enabled', false),
# DEPRECATED PARAMETERS
$memcached_ips = undef
) {
@ -109,5 +114,9 @@ class tripleo::profile::base::horizon (
horizon_cert => $tls_certfile,
horizon_key => $tls_keyfile,
}
if $heat_api_enabled {
include horizon::dashboards::heat
}
}
}

View File

@ -28,6 +28,7 @@ describe 'tripleo::profile::base::horizon' do
it 'should do nothing' do
is_expected.to contain_class('tripleo::profile::base::horizon')
is_expected.to_not contain_class('horizon')
is_expected.to_not contain_class('horizon::dashboards::heat')
end
end
@ -38,6 +39,7 @@ describe 'tripleo::profile::base::horizon' do
it 'should not configure anything' do
is_expected.to_not contain_class('horizon')
is_expected.to_not contain_class('horizon::dashboards::heat')
is_expected.to_not contain_class('apache::mod::remoteip')
is_expected.to_not contain_class('apache::mod::status')
end
@ -51,6 +53,7 @@ describe 'tripleo::profile::base::horizon' do
it 'should trigger complete configuration' do
is_expected.to contain_class('horizon')
is_expected.to_not contain_class('horizon::dashboards::heat')
is_expected.to contain_class('apache::mod::remoteip')
is_expected.to contain_class('apache::mod::status')
end
@ -64,6 +67,22 @@ describe 'tripleo::profile::base::horizon' do
it 'should trigger complete configuration' do
is_expected.to contain_class('horizon')
is_expected.to_not contain_class('horizon::dashboards::heat')
is_expected.to contain_class('apache::mod::remoteip')
is_expected.to contain_class('apache::mod::status')
end
end
context 'with step 4 and heat enabled' do
let(:params) { {
:step => 4,
:bootstrap_node => 'node.example.com',
:heat_api_enabled => true,
} }
it 'should trigger complete configuration with heat dashboard' do
is_expected.to contain_class('horizon')
is_expected.to contain_class('horizon::dashboards::heat')
is_expected.to contain_class('apache::mod::remoteip')
is_expected.to contain_class('apache::mod::status')
end