Add execution_interval to the Mistral manifest

Related-Bug: #1747386
Depends-On: I9060253bc416be28af4ef81f3edf694059d92066
Change-Id: I6445ff1b6691a098f15e8402ae9d971e751f5552
This commit is contained in:
Dougal Matthews
2018-02-05 15:08:41 +00:00
parent 976778cff3
commit f0c834bf9a
3 changed files with 20 additions and 1 deletions

View File

@@ -11,15 +11,28 @@
# (boolean value)
# Defaults to $::os_service_default.
#
# [*execution_interval*]
# (Optional) This setting defines how frequently Mistral checks for cron
# triggers that need execution. By default this is every second
# which can lead to high system load. Increasing the number will
# reduce the load but also limit the minimum freqency. For
# example, a cron trigger can be configured to run every second
# but if the execution_interval is set to 60, it will only run
# once per minute.
# (integer value)
# Defaults to $::os_service_default.
#
#
class mistral::cron_trigger (
$enabled = $::os_service_default,
$execution_interval = $::os_service_default,
) {
include ::mistral::deps
include ::mistral::params
mistral_config {
'cron_trigger/enabled': value => $enabled;
'cron_trigger/enabled': value => $enabled;
'cron_trigger/execution_interval': value => $execution_interval;
}
}

View File

@@ -0,0 +1,3 @@
---
features:
- Add the execution_interval parameter to the cron trigger manifest.

View File

@@ -5,16 +5,19 @@ describe 'mistral::cron_trigger' do
shared_examples_for 'mistral cron trigger' do
it 'configure cron trigger default params' do
is_expected.to contain_mistral_config('cron_trigger/enabled').with_value('<SERVICE DEFAULT>')
is_expected.to contain_mistral_config('cron_trigger/execution_interval').with_value('<SERVICE DEFAULT>')
end
context 'with specific parameters' do
let :params do
{ :enabled => true,
:execution_interval => 60,
}
end
it 'configure cron trigger params' do
is_expected.to contain_mistral_config('cron_trigger/enabled').with_value(true)
is_expected.to contain_mistral_config('cron_trigger/execution_interval').with_value(60)
end
end
end