Provide config class interface for rootwrap.conf

This introduces the new neutron::config class parameter to allow users
to inject arbitrary configurations to rootwrap.conf.

Change-Id: If4dade21a7f10f6138c71d275ef84c608289be1a
This commit is contained in:
Takashi Kajinami 2024-01-22 12:10:33 +09:00
parent 4df4d3f5a8
commit 19b9345599
3 changed files with 26 additions and 1 deletions

View File

@ -27,6 +27,9 @@
# [*api_paste_ini*]
# (optional) Manage configuration of api-paste.ini
#
# [*rootwrap_config*]
# (optional) Allow configuration of rootwrap.conf configurations.
#
# [*ovs_agent_config*]
# (optional) Manage configuration of openvswitch_agent.ini
#
@ -98,6 +101,7 @@
class neutron::config (
Hash $server_config = {},
Hash $api_paste_ini = {},
Hash $rootwrap_config = {},
Hash $ovs_agent_config = {},
Hash $ovn_agent_config = {},
Hash $sriov_agent_config = {},
@ -144,6 +148,7 @@ class neutron::config (
create_resources('neutron_config', $server_config)
create_resources('neutron_api_paste_ini', $api_paste_ini)
create_resources('neutron_rootwrap_config', $rootwrap_config)
create_resources('neutron_agent_ovs', $ovs_agent_config)
create_resources('neutron_agent_ovn', $ovn_agent_config)
create_resources('neutron_sriov_agent_config', $sriov_agent_config)

View File

@ -0,0 +1,4 @@
---
features:
- |
The new ``neutron::config::rootwrap_config`` parameter has been added.

View File

@ -27,13 +27,28 @@ describe 'neutron::config' do
{ :api_paste_ini => config_hash }
end
it 'configures arbitrary neutron-api-config configurations' do
it 'configures arbitrary neutron-api-paste configurations' do
should contain_neutron_api_paste_ini('DEFAULT/foo').with_value('fooValue')
should contain_neutron_api_paste_ini('DEFAULT/bar').with_value('barValue')
should contain_neutron_api_paste_ini('DEFAULT/baz').with_ensure('absent')
end
end
shared_examples 'neutron_rootwrap_config' do
let :params do
{ :rootwrap_config => config_hash }
end
it { should contain_class('neutron::deps') }
it 'configures arbitrary rootwrap configurations' do
should contain_neutron_rootwrap_config('DEFAULT/foo').with_value('fooValue')
should contain_neutron_rootwrap_config('DEFAULT/bar').with_value('barValue')
should contain_neutron_rootwrap_config('DEFAULT/baz').with_ensure('absent')
end
end
shared_examples 'neutron_service_config' do
let :params do
{ :sfc_service_config => config_hash,
@ -184,6 +199,7 @@ describe 'neutron::config' do
it_behaves_like 'neutron_config'
it_behaves_like 'neutron_api_paste_ini'
it_behaves_like 'neutron_rootwrap_config'
it_behaves_like 'neutron_service_config'
it_behaves_like 'neutron_agent_config'
it_behaves_like 'neutron_plugin_config'