taas: Support taas_agent_periodic_interval option

Change-Id: Id9a99c18ffecb86ddabfe7aa997c0ca0211fe8a5
This commit is contained in:
Takashi Kajinami
2024-09-19 00:09:12 +09:00
parent 87862a8ad1
commit e82c130cec
3 changed files with 25 additions and 5 deletions

View File

@@ -19,6 +19,10 @@
# [*package_ensure*]
# (optional) Ensure state for package. Defaults to 'present'.
#
# [*taas_agent_periodic_interval*]
# (optional) Seconds between periodic task runs.
# Defaults to $facts['os_service_default'].
#
# DEPRECATED PARAMETERS
#
# [*vlan_range_start*]
@@ -30,10 +34,11 @@
# Defaults to $facts['os_service_default'].
#
class neutron::agents::taas (
$package_ensure = present,
$package_ensure = present,
$taas_agent_periodic_interval = $facts['os_service_default'],
# DEPRECATED PARAMETERS
$vlan_range_start = undef,
$vlan_range_end = undef,
$vlan_range_start = undef,
$vlan_range_end = undef,
) {
include neutron::deps
@@ -49,6 +54,13 @@ Use the neutron::services::taas class parametes instead.")
}
}
# NOTE(tkajinam): taas provides not its own agent but l2 agent extension so
# configure these options in the core plugin file so that
# these options are loaded by l2 agents such as ovs-agent.
neutron_plugin_ml2 {
'DEFAULT/taas_agent_periodic_interval': value => $taas_agent_periodic_interval;
}
neutron_plugin_ml2 {
'taas/vlan_range_start': value => pick($vlan_range_start, $facts['os_service_default']);
'taas/vlan_range_end': value => pick($vlan_range_end, $facts['os_service_default']);

View File

@@ -0,0 +1,5 @@
---
features:
- |
The new ``neutron::agents::taas::taas_agent_periodic_interval`` parameter
has been added.

View File

@@ -14,6 +14,7 @@ describe 'neutron::agents::taas' do
it { should contain_class('neutron::params') }
it 'configures ml2_plugin.conf' do
should contain_neutron_plugin_ml2('DEFAULT/taas_agent_periodic_interval').with_value('<SERVICE DEFAULT>')
should contain_neutron_plugin_ml2('taas/vlan_range_start').with_value('<SERVICE DEFAULT>')
should contain_neutron_plugin_ml2('taas/vlan_range_end').with_value('<SERVICE DEFAULT>')
end
@@ -30,12 +31,14 @@ describe 'neutron::agents::taas' do
context 'with parameters' do
let :params do
{
:vlan_range_start => 1,
:vlan_range_end => 100,
:taas_agent_periodic_interval => 5,
:vlan_range_start => 1,
:vlan_range_end => 100,
}
end
it 'configures ml2_plugin.conf' do
should contain_neutron_plugin_ml2('DEFAULT/taas_agent_periodic_interval').with_value(5)
should contain_neutron_plugin_ml2('taas/vlan_range_start').with_value(1)
should contain_neutron_plugin_ml2('taas/vlan_range_end').with_value(100)
end