Merge "Add support for aodh-expirer cron job"

This commit is contained in:
Zuul 2020-09-03 13:23:01 +00:00 committed by Gerrit Code Review
commit 0d59a15a89
2 changed files with 42 additions and 4 deletions

View File

@ -48,13 +48,17 @@
# for more details.
# Defaults to hiera('step')
#
# [*enable_aodh_expirer*]
# (Optional) Whether aodh expirer should be configured
# Defaults to hiera('enable_aodh_expirer', true)
#
class tripleo::profile::base::aodh::api (
$aodh_network = hiera('aodh_api_network', undef),
$bootstrap_node = hiera('aodh_api_bootstrap_node_name', undef),
$certificates_specs = hiera('apache_certificates_specs', {}),
$enable_internal_tls = hiera('enable_internal_tls', false),
$step = Integer(hiera('step')),
$enable_aodh_expirer = true,
) {
if $bootstrap_node and $::hostname == downcase($bootstrap_node) {
$is_bootstrap = true
@ -76,7 +80,6 @@ class tripleo::profile::base::aodh::api (
$tls_keyfile = undef
}
if $step >= 4 or ( $step >= 3 and $is_bootstrap ) {
warning('Service aodh is deprecated. Please take in mind, that it is going to be removed in T release.')
include aodh::api
@ -86,4 +89,10 @@ class tripleo::profile::base::aodh::api (
ssl_key => $tls_keyfile,
}
}
if $step >= 5 {
if $enable_aodh_expirer {
include aodh::expirer
}
}
}

View File

@ -35,6 +35,7 @@ describe 'tripleo::profile::base::aodh::api' do
is_expected.to contain_class('tripleo::profile::base::aodh')
is_expected.to_not contain_class('aodh::api')
is_expected.to_not contain_class('aodh::wsgi::apache')
is_expected.to_not contain_class('aodh::expirer')
end
end
@ -44,8 +45,9 @@ describe 'tripleo::profile::base::aodh::api' do
} }
it 'should trigger complete configuration' do
is_expected.not_to contain_class('aodh::api')
is_expected.not_to contain_class('aodh::wsgi::apache')
is_expected.to_not contain_class('aodh::api')
is_expected.to_not contain_class('aodh::wsgi::apache')
is_expected.to_not contain_class('aodh::expirer')
end
end
@ -58,6 +60,7 @@ describe 'tripleo::profile::base::aodh::api' do
it 'should trigger complete configuration' do
is_expected.to contain_class('aodh::api')
is_expected.to contain_class('aodh::wsgi::apache')
is_expected.to_not contain_class('aodh::expirer')
end
end
@ -69,6 +72,32 @@ describe 'tripleo::profile::base::aodh::api' do
it 'should trigger complete configuration' do
is_expected.to contain_class('aodh::api')
is_expected.to contain_class('aodh::wsgi::apache')
is_expected.to_not contain_class('aodh::expirer')
end
end
context 'with step 5' do
let(:params) { {
:step => 5,
} }
it 'should trigger complete configuration' do
is_expected.to contain_class('aodh::api')
is_expected.to contain_class('aodh::wsgi::apache')
is_expected.to contain_class('aodh::expirer')
end
end
context 'with step 5 without expirer' do
let(:params) { {
:step => 5,
:enable_aodh_expirer => false
} }
it 'should trigger complete configuration' do
is_expected.to contain_class('aodh::api')
is_expected.to contain_class('aodh::wsgi::apache')
is_expected.to_not contain_class('aodh::expirer')
end
end
end