From 9cab6d703e6df6cbef391a58aafab27e69d42d33 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 9 May 2021 10:59:46 +0900 Subject: [PATCH] Horizon: Enable octavia-dashboard configurations Depends-on: https://review.opendev.org/802203 Change-Id: Idcb1aa7c496c6d158791c6d499069d919b9d363a (cherry picked from commit 8a00edfa0b46440910a20b86fbfedeb377c87bd5) (cherry picked from commit 34712a303fc3f5be4f91601aae4177fa72502827) (cherry picked from commit d30b18cdb62ef4706d3dba34fe20a271287359d9) --- manifests/profile/base/horizon.pp | 9 ++++++++ .../tripleo_profile_base_horizon_spec.rb | 21 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/manifests/profile/base/horizon.pp b/manifests/profile/base/horizon.pp index 4ff1d400d..bf00a3473 100644 --- a/manifests/profile/base/horizon.pp +++ b/manifests/profile/base/horizon.pp @@ -66,6 +66,10 @@ # (Optional) Indicate whether Heat is available in the deployment. # Defaults to hiera('heat_api_enabled') or false # +# [*octavia_api_enabled*] +# (Optional) Indicate whether Octavia is available in the deployment. +# Defaults to hiera('octavia_api_enabled') or false +# class tripleo::profile::base::horizon ( $step = Integer(hiera('step')), $bootstrap_node = hiera('horizon_short_bootstrap_node_name', undef), @@ -75,6 +79,7 @@ class tripleo::profile::base::horizon ( $neutron_options = hiera('horizon::neutron_options', {}), $memcached_hosts = hiera('memcached_node_names', []), $heat_api_enabled = hiera('heat_api_enabled', false), + $octavia_api_enabled = hiera('octavia_api_enabled', false), # DEPRECATED PARAMETERS $memcached_ips = undef ) { @@ -118,5 +123,9 @@ class tripleo::profile::base::horizon ( if $heat_api_enabled { include horizon::dashboards::heat } + + if $octavia_api_enabled { + include horizon::dashboards::octavia + } } } diff --git a/spec/classes/tripleo_profile_base_horizon_spec.rb b/spec/classes/tripleo_profile_base_horizon_spec.rb index 440b7e9b1..2e284a154 100644 --- a/spec/classes/tripleo_profile_base_horizon_spec.rb +++ b/spec/classes/tripleo_profile_base_horizon_spec.rb @@ -29,6 +29,7 @@ describe 'tripleo::profile::base::horizon' 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') + is_expected.to_not contain_class('horizon::dashboards::octavia') end end @@ -40,6 +41,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('horizon::dashboards::octavia') is_expected.to_not contain_class('apache::mod::remoteip') is_expected.to_not contain_class('apache::mod::status') end @@ -54,6 +56,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_not contain_class('horizon::dashboards::octavia') is_expected.to contain_class('apache::mod::remoteip') is_expected.to contain_class('apache::mod::status') end @@ -68,6 +71,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_not contain_class('horizon::dashboards::octavia') is_expected.to contain_class('apache::mod::remoteip') is_expected.to contain_class('apache::mod::status') end @@ -83,6 +87,23 @@ describe 'tripleo::profile::base::horizon' do 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_not contain_class('horizon::dashboards::octavia') + is_expected.to contain_class('apache::mod::remoteip') + is_expected.to contain_class('apache::mod::status') + end + end + + context 'with step 4 and octavia enabled' do + let(:params) { { + :step => 4, + :bootstrap_node => 'node.example.com', + :octavia_api_enabled => true, + } } + + it 'should trigger complete configuration with heat dashboard' do + is_expected.to contain_class('horizon') + is_expected.to_not contain_class('horizon::dashboards::heat') + is_expected.to contain_class('horizon::dashboards::octavia') is_expected.to contain_class('apache::mod::remoteip') is_expected.to contain_class('apache::mod::status') end