Add support for aodh-expirer cron job
Related-Bug: #1891888 Depends-on: https://review.opendev.org/#/c/746241/ Change-Id: I9bc8a4ffde6e24edaa9744478d699ccc5243b784
This commit is contained in:
parent
ab38478bd8
commit
dadf19c6e3
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user