Merge "Add service tunable parameters of tacker-conductor"

This commit is contained in:
Zuul 2022-01-10 19:37:36 +00:00 committed by Gerrit Code Review
commit c21b9b3bbe
3 changed files with 54 additions and 3 deletions

View File

@ -14,10 +14,26 @@
# (Optional) Ensure state for package.
# Defaults to 'present'
#
# [*report_interval*]
# (Optional) Seconds between running components report states.
# Defaults to $::os_service_default.
#
# [*periodic_interval*]
# (Optional) Seconds between running periodic tasks.
# Defaults to $::os_service_default.
#
# [*periodic_fuzzy_delay*]
# (Optional) Range of seconds to randomly delay when starting the periodic
# task scheduler to reduce stampeding.
# Defaults to $::os_service_default.
#
class tacker::conductor(
$manage_service = true,
$enabled = true,
$package_ensure = 'present',
$manage_service = true,
$enabled = true,
$package_ensure = 'present',
$report_interval = $::os_service_default,
$periodic_interval = $::os_service_default,
$periodic_fuzzy_delay = $::os_service_default,
) {
include tacker::deps
@ -29,6 +45,12 @@ class tacker::conductor(
tag => ['openstack', 'tacker-package'],
})
tacker_config {
'DEFAULT/report_interval': value => $report_interval;
'DEFAULT/periodic_interval': value => $periodic_interval;
'DEFAULT/periodic_fuzzy_delay': value => $periodic_fuzzy_delay;
}
if $manage_service {
if $enabled {
$service_ensure = 'running'

View File

@ -0,0 +1,9 @@
---
features:
- |
The following parameters have been added to the ``tacker::conductor``
class.
- ``report_interval``
- ``periodic_interval``
- ``periodic_fuzzy_delay``

View File

@ -17,6 +17,12 @@ describe 'tacker::conductor' do
it { is_expected.to contain_class('tacker::deps') }
it { is_expected.to contain_class('tacker::params') }
it {
is_expected.to contain_tacker_config('DEFAULT/report_interval').with_value('<SERVICE DEFAULT>')
is_expected.to contain_tacker_config('DEFAULT/periodic_interval').with_value('<SERVICE DEFAULT>')
is_expected.to contain_tacker_config('DEFAULT/periodic_fuzzy_delay').with_value('<SERVICE DEFAULT>')
}
[{:enabled => true}, {:enabled => false}].each do |param_hash|
context "when service should be #{param_hash[:enabled] ? 'enabled' : 'disabled'}" do
before do
@ -41,6 +47,20 @@ describe 'tacker::conductor' do
end
end
context 'when parameters set' do
before do
params.merge!(
:report_interval => 10,
:periodic_interval => 40,
:periodic_fuzzy_delay => 5,
)
end
it {
is_expected.to contain_tacker_config('DEFAULT/report_interval').with_value(10)
is_expected.to contain_tacker_config('DEFAULT/periodic_interval').with_value(40)
is_expected.to contain_tacker_config('DEFAULT/periodic_fuzzy_delay').with_value(5)
}
end
end
on_supported_os({