Addition of Nuage configuration to neutron-server conf directory

Added nuage configuration file under neutron-server configuration
directory so that neutron-server can pick up the configuration file on
startup. This change creates nuage_plugin.conf symlink under the folder
/etc/neutron/conf.d/neutron-server

Change-Id: I41aad89ff982657c6f0ccc2076bc322484b37d73
This commit is contained in:
Lokesh Jain 2017-07-28 17:38:17 -04:00
parent 4b5ff430a6
commit a87919c463
3 changed files with 44 additions and 0 deletions

View File

@ -60,6 +60,22 @@ class neutron::plugins::ml2::nuage (
tag => 'neutron-config-file', tag => 'neutron-config-file',
} }
if $::osfamily == 'Debian' {
file_line { 'neutron-server-DAEMON_ARGS':
path => '/etc/default/neutron-server',
line => 'DAEMON_ARGS="$DAEMON_ARGS --config-file /etc/neutron/plugins/nuage/plugin.ini"',
}
}
if $::osfamily == 'Redhat' {
file { '/etc/neutron/conf.d/neutron-server/nuage_plugin.conf':
ensure => link,
require => File['/etc/neutron/plugins/nuage/plugin.ini'],
target => $::neutron::params::nuage_config_file,
tag => 'neutron-config-file',
}
}
file { '/etc/neutron/plugins/nuage/plugin.ini': file { '/etc/neutron/plugins/nuage/plugin.ini':
ensure => file, ensure => file,
owner => 'root', owner => 'root',

View File

@ -0,0 +1,6 @@
---
features:
- Added nuage configuration file under neutron-server configuration
directory so that neutron-server can pick up the configuration file on
startup. This change creates nuage_plugin.conf symlink under the folder
/etc/neutron/conf.d/neutron-server.

View File

@ -72,6 +72,13 @@ describe 'neutron::plugins::ml2::nuage' do
it_raises 'a Puppet::Error', /Nuage should be the mechanism driver in neutron.conf/ it_raises 'a Puppet::Error', /Nuage should be the mechanism driver in neutron.conf/
end end
it 'should have a nuage plugin conf file' do
is_expected.to contain_file(platform_params[:nuage_conf_file]).with(
:ensure => platform_params[:nuage_file_ensure],
:target => platform_params[:nuage_file_target]
)
end
context 'configure ml2 nuage with wrong mechanism_driver configuration' do context 'configure ml2 nuage with wrong mechanism_driver configuration' do
let :pre_condition do let :pre_condition do
"class { '::neutron::plugins::ml2': "class { '::neutron::plugins::ml2':
@ -90,6 +97,21 @@ describe 'neutron::plugins::ml2::nuage' do
facts.merge!(OSDefaults.get_facts()) facts.merge!(OSDefaults.get_facts())
end end
let (:platform_params) do
case facts[:osfamily]
when 'RedHat'
{ :nuage_conf_file => '/etc/neutron/conf.d/neutron-server/nuage_plugin.conf',
:nuage_file_ensure => 'link',
:nuage_file_target => '/etc/neutron/plugins/nuage/plugin.ini'
}
when 'Debian'
{ :nuage_conf_file => '/etc/default/neutron-server',
:nuage_file_ensure => 'present',
:nuage_file_target => nil
}
end
end
it_configures 'neutron plugin ml2 nuage' it_configures 'neutron plugin ml2 nuage'
end end
end end