Merge "Add service tunable parameters of tacker-conductor"
This commit is contained in:
commit
c21b9b3bbe
|
@ -14,10 +14,26 @@
|
||||||
# (Optional) Ensure state for package.
|
# (Optional) Ensure state for package.
|
||||||
# Defaults to 'present'
|
# 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(
|
class tacker::conductor(
|
||||||
$manage_service = true,
|
$manage_service = true,
|
||||||
$enabled = true,
|
$enabled = true,
|
||||||
$package_ensure = 'present',
|
$package_ensure = 'present',
|
||||||
|
$report_interval = $::os_service_default,
|
||||||
|
$periodic_interval = $::os_service_default,
|
||||||
|
$periodic_fuzzy_delay = $::os_service_default,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include tacker::deps
|
include tacker::deps
|
||||||
|
@ -29,6 +45,12 @@ class tacker::conductor(
|
||||||
tag => ['openstack', 'tacker-package'],
|
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 $manage_service {
|
||||||
if $enabled {
|
if $enabled {
|
||||||
$service_ensure = 'running'
|
$service_ensure = 'running'
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The following parameters have been added to the ``tacker::conductor``
|
||||||
|
class.
|
||||||
|
|
||||||
|
- ``report_interval``
|
||||||
|
- ``periodic_interval``
|
||||||
|
- ``periodic_fuzzy_delay``
|
|
@ -17,6 +17,12 @@ describe 'tacker::conductor' do
|
||||||
it { is_expected.to contain_class('tacker::deps') }
|
it { is_expected.to contain_class('tacker::deps') }
|
||||||
it { is_expected.to contain_class('tacker::params') }
|
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|
|
[{:enabled => true}, {:enabled => false}].each do |param_hash|
|
||||||
context "when service should be #{param_hash[:enabled] ? 'enabled' : 'disabled'}" do
|
context "when service should be #{param_hash[:enabled] ? 'enabled' : 'disabled'}" do
|
||||||
before do
|
before do
|
||||||
|
@ -41,6 +47,20 @@ describe 'tacker::conductor' do
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
||||||
on_supported_os({
|
on_supported_os({
|
||||||
|
|
Loading…
Reference in New Issue