Add support for glance db purge job

Related-Bug: #1892467
Depends-on: https://review.opendev.org/#/c/746452/
Change-Id: Ie9cd653cc6d66911d00f9a92db30f33e2e1d1ad9
This commit is contained in:
Takashi Kajinami 2020-08-21 16:29:21 +09:00
parent ab38478bd8
commit d1b78d7946
2 changed files with 38 additions and 0 deletions

View File

@ -123,6 +123,10 @@
# enable_internal_tls is set.
# defaults to 9292
#
# [*glance_enable_db_purge*]
# (optional) Whether to enable db purging
# defaults to true
#
# DEPRECATED PARAMETERS
#
# [*glance_rbd_client_name*]
@ -153,6 +157,7 @@ class tripleo::profile::base::glance::api (
$tls_proxy_bind_ip = undef,
$tls_proxy_fqdn = undef,
$tls_proxy_port = 9292,
$glance_enable_db_purge = true,
# DEPRECATED PARAMETERS
$glance_rbd_client_name = undef,
) {
@ -249,4 +254,10 @@ class tripleo::profile::base::glance::api (
}
}
if $step >= 5 {
if $glance_enable_db_purge {
include glance::cron::db_purge
}
}
}

View File

@ -35,6 +35,7 @@ describe 'tripleo::profile::base::glance::api' do
is_expected.to_not contain_class('glance::api::logging')
is_expected.to_not contain_class('glance::api')
is_expected.to_not contain_class('glance::notify::rabbitmq')
is_expected.to_not contain_class('glance::cron::db_purge')
end
end
@ -62,6 +63,7 @@ describe 'tripleo::profile::base::glance::api' do
:default_transport_url => 'rabbit://glance1:foo@192.168.0.1:1234/?ssl=0',
:notification_transport_url => 'rabbit://glance2:baa@192.168.0.2:5678/?ssl=0',
)
is_expected.to_not contain_class('glance::cron::db_purge')
end
end
@ -78,6 +80,7 @@ describe 'tripleo::profile::base::glance::api' do
is_expected.to_not contain_class('glance::api::logging')
is_expected.to_not contain_class('glance::api')
is_expected.to_not contain_class('glance::notify::rabbitmq')
is_expected.to_not contain_class('glance::cron::db_purge')
end
end
@ -114,6 +117,7 @@ describe 'tripleo::profile::base::glance::api' do
:default_transport_url => 'rabbit://glance1:foo@192.168.0.1:1234/?ssl=0',
:notification_transport_url => 'rabbit://glance2:baa@192.168.0.2:5678/?ssl=0',
)
is_expected.to_not contain_class('glance::cron::db_purge')
end
context 'with multistore_config' do
@ -181,6 +185,29 @@ describe 'tripleo::profile::base::glance::api' do
it_raises 'a Puppet::Error', / does not specify a glance_backend./
end
end
context 'with step 5' do
let(:params) { {
:step => 5,
:bootstrap_node => 'node.example.com',
} }
it 'should configure db_purge' do
is_expected.to contain_class('glance::cron::db_purge')
end
end
context 'with step 5 without db_purge' do
let(:params) { {
:step => 5,
:bootstrap_node => 'node.example.com',
:glance_enable_db_purge => false,
} }
it 'should configure db_purge' do
is_expected.to_not contain_class('glance::cron::db_purge')
end
end
end
on_supported_os.each do |os, facts|