Browse Source

Merge "Add service tunable parameters of tacker-conductor"

changes/99/825999/1
Zuul 4 months ago committed by Gerrit Code Review
parent
commit
c21b9b3bbe
  1. 28
      manifests/conductor.pp
  2. 9
      releasenotes/notes/service-opts-fb0b928f265220f1.yaml
  3. 20
      spec/classes/tacker_conductor_spec.rb

28
manifests/conductor.pp

@ -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'

9
releasenotes/notes/service-opts-fb0b928f265220f1.yaml

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

20
spec/classes/tacker_conductor_spec.rb

@ -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({

Loading…
Cancel
Save