Remove support for nuage plugin

The nuage plugin has been retired[1].

[1] https://github.com/nuagenetworks/nuage-openstack-neutron/tree/master

Change-Id: I35220be931b6ea8fc35536ae10aa51d19c22b79d
This commit is contained in:
Takashi Kajinami 2023-10-23 11:07:47 +09:00
parent 5078eb55e1
commit 10b599e4a1
10 changed files with 18 additions and 351 deletions

View File

@ -1,16 +0,0 @@
Puppet::Type.type(:neutron_plugin_nuage).provide(
:ini_setting,
:parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
) do
def self.file_path
'/etc/neutron/plugins/nuage/plugin.ini'
end
# added for backwards compatibility with older versions of inifile
def file_path
self.class.file_path
end
end

View File

@ -1,55 +0,0 @@
Puppet::Type.newtype(:neutron_plugin_nuage) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage for nuage/plugin.ini (DEPRECATED)'
newvalues(/\S+\/\S+/)
end
newproperty(:value) do
desc 'The value of the settings to be defined.'
munge do |value|
value = value.to_s.strip
value.capitalize! if value =~ /^(true|false)$/i
value
end
def is_to_s( currentvalue )
if resource.secret?
return '[old secret redacted]'
else
return currentvalue
end
end
def should_to_s( newvalue )
if resource.secret?
return '[new secret redacted]'
else
return newvalue
end
end
end
newparam(:secret, :boolean => true) do
desc 'Whether to hide the value from Puppet logs. Defaults to `false`.'
newvalues(:true, :false)
defaultto false
end
newparam(:ensure_absent_val) do
desc 'A value that is specified as the value property will behave as if ensure => absent was specified'
defaultto('<SERVICE DEFAULT>')
end
autorequire(:anchor) do
['neutron::install::end']
end
autorequire(:file) do
'/etc/neutron/plugins/nuage/plugin.ini'
end
end

View File

@ -78,9 +78,6 @@
# [*plugin_opencontrail_config*]
# (optional) Manage configuration of plugins/opencontrail/ContrailPlugin.ini
#
# [*plugin_nuage_config*]
# (optional) Manage configuration of plugins/nuage/plugin.ini
#
# [*plugin_ml2_config*]
# (optional) Manage configuration of ml2_conf.ini
#
@ -89,6 +86,9 @@
# [*linuxbridge_agent_config*]
# (optional) Manage configuration of linuxbridge_agent.ini
#
# [*plugin_nuage_config*]
# (optional) Manage configuration of plugins/nuage/plugin.ini
#
# NOTE: The configuration MUST NOT be already handled by this module
# or Puppet catalog compilation will fail with duplicate resources.
#
@ -112,10 +112,10 @@ class neutron::config (
Hash $vpnaas_agent_config = {},
Hash $bgp_dragent_config = {},
Hash $plugin_opencontrail_config = {},
Hash $plugin_nuage_config = {},
Hash $plugin_ml2_config = {},
# DEPRECATED PARAMETERS
Optional[Hash] $linuxbridge_agent_config = undef,
Optional[Hash] $plugin_nuage_config = undef,
) {
include neutron::deps
@ -127,6 +127,10 @@ class neutron::config (
$linuxbridge_agent_config_real = {}
}
if $plugin_nuage_config != undef {
warning('The plugin_nuage_config parameter is deprecated and has no effect.')
}
create_resources('neutron_config', $server_config)
create_resources('neutron_api_paste_ini', $api_paste_ini)
create_resources('neutron_agent_ovs', $ovs_agent_config)
@ -147,6 +151,5 @@ class neutron::config (
create_resources('neutron_vpnaas_agent_config', $vpnaas_agent_config)
create_resources('neutron_bgp_dragent_config', $bgp_dragent_config)
create_resources('neutron_plugin_opencontrail', $plugin_opencontrail_config)
create_resources('neutron_plugin_nuage', $plugin_nuage_config)
create_resources('neutron_plugin_ml2', $plugin_ml2_config)
}

View File

@ -50,7 +50,6 @@ class neutron::deps {
Anchor['neutron::config::begin'] -> Neutron_bgp_dragent_config<||> -> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_l2gw_service_config<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_plugin_ml2<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_plugin_nuage<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_plugin_opencontrail<||> ~> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_sriov_agent_config<||> -> Anchor['neutron::config::end']
Anchor['neutron::config::begin'] -> Neutron_vpnaas_agent_config<||> -> Anchor['neutron::config::end']

View File

@ -12,7 +12,6 @@ class neutron::params {
$macvtap_agent_service = 'neutron-macvtap-agent'
$opencontrail_plugin_package = 'neutron-plugin-contrail'
$opencontrail_config_file = '/etc/neutron/plugins/opencontrail/ContrailPlugin.ini'
$nuage_config_file = '/etc/neutron/plugins/nuage/plugin.ini'
$dhcp_agent_service = 'neutron-dhcp-agent'
$metering_agent_service = 'neutron-metering-agent'
$l3_agent_service = 'neutron-l3-agent'

View File

@ -1,117 +0,0 @@
#
# DEPRECATED !!
# Configure the Nuage plugin for neutron.
#
# === Parameters
#
# [*nuage_net_partition_name*]
# (required) The net partition under which the VMs will be
# seen in the VSD
#
# [*nuage_vsd_ip*]
# (required) IP address of the Virtual Services Directory
#
# [*nuage_vsd_username*]
# (required) Username to be used to log into VSD
#
# [*nuage_vsd_password*]
# (required) Password to be used to log into VSD
#
# [*nuage_vsd_organization*]
# (required) Parameter required to log into VSD
#
# [*nuage_base_uri_version*]
# (required) URI version to be used based on the VSD release
# For example v3_0
#
# [*nuage_cms_id*]
# (required) CMS ID generated by the VSD
#
# [*nuage_auth_resource*]
# (optional) The auth resource value to be use to connect
# to VSD. The default is /me
#
# [*nuage_server_ssl*]
# (optional) Flag to determine whether to use ssl connection
# to connect to VSD. The default is True
#
# [*purge_config*]
# (optional) Whether to set only the specified config options
# in the nuage config.
# Defaults to false.
#
# [*nuage_default_allow_non_ip*]
# (optional) Whether to allow non-IP traffic.
# Defaults to false.
#
class neutron::plugins::ml2::nuage (
$nuage_net_partition_name,
$nuage_vsd_ip,
$nuage_vsd_username,
$nuage_vsd_password,
$nuage_vsd_organization,
$nuage_base_uri_version,
$nuage_cms_id,
$nuage_auth_resource = '/me',
$nuage_server_ssl = true,
Boolean $purge_config = false,
$nuage_default_allow_non_ip = false,
) {
include neutron::deps
include neutron::params
warning('Support for ml2 Nuage plugin has been deprecated.')
file { '/etc/neutron/plugins/nuage':
ensure => directory,
tag => 'neutron-config-file',
}
case $facts['os']['family'] {
'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"',
tag => 'neutron-file-line'
}
}
'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',
}
}
default : {
fail("Unsupported osfamily: ${facts['os']['family']}")
}
}
file { '/etc/neutron/plugins/nuage/plugin.ini':
ensure => file,
owner => 'root',
group => $::neutron::params::group,
require => File['/etc/neutron/plugins/nuage'],
mode => '0640',
tag => 'neutron-config-file',
}
resources { 'neutron_plugin_nuage':
purge => $purge_config,
}
$nuage_base_uri_base = '/nuage/api'
neutron_plugin_nuage {
'RESTPROXY/default_net_partition_name': value => $nuage_net_partition_name;
'RESTPROXY/server': value => $nuage_vsd_ip;
'RESTPROXY/serverauth': value => "${nuage_vsd_username}:${nuage_vsd_password}", secret => true;
'RESTPROXY/organization': value => $nuage_vsd_organization;
'RESTPROXY/auth_resource': value => $nuage_auth_resource;
'RESTPROXY/serverssl': value => $nuage_server_ssl;
'RESTPROXY/base_uri': value => "${nuage_base_uri_base}/${nuage_base_uri_version}";
'RESTPROXY/cms_id': value => $nuage_cms_id;
'PLUGIN/default_allow_non_ip': value => $nuage_default_allow_non_ip;
}
}

View File

@ -0,0 +1,9 @@
---
upgrade:
- |
Support for the nuage ml2 plugin has been removed.
deprecations:
- |
The ``neutron::config::plugin_nuage_config`` parameter has been deprecated
and has no effect now.

View File

@ -149,7 +149,6 @@ describe 'neutron::config' do
let :params do
{
:plugin_opencontrail_config => config_hash,
:plugin_nuage_config => config_hash,
:plugin_ml2_config => config_hash
}
end
@ -160,12 +159,6 @@ describe 'neutron::config' do
should contain_neutron_plugin_opencontrail('DEFAULT/baz').with_ensure('absent')
end
it 'configures arbitrary neutron_plugin_nuage configurations' do
should contain_neutron_plugin_nuage('DEFAULT/foo').with_value('fooValue')
should contain_neutron_plugin_nuage('DEFAULT/bar').with_value('barValue')
should contain_neutron_plugin_nuage('DEFAULT/baz').with_ensure('absent')
end
it 'configures arbitrary neutron_plugin_ml2 configurations' do
should contain_neutron_plugin_ml2('DEFAULT/foo').with_value('fooValue')
should contain_neutron_plugin_ml2('DEFAULT/bar').with_value('barValue')

View File

@ -1,106 +0,0 @@
require 'spec_helper'
describe 'neutron::plugins::ml2::nuage' do
let :pre_condition do
"class { 'neutron':
core_plugin => 'ml2' }
class { 'neutron::keystone::authtoken':
password => 'passw0rd',
}
class { 'neutron::server': }
class { 'neutron::plugins::ml2':
mechanism_drivers => ['nuage'] }"
end
let :params do
{
:nuage_vsd_ip => %w(192.168.33.3),
:nuage_vsd_username => 'test',
:nuage_vsd_password => 'test',
:nuage_vsd_organization => 'vsd',
:nuage_net_partition_name => 'test',
:nuage_base_uri_version => 'v3.0',
:nuage_cms_id => '7488fae2-7e51-11e5-8bcf-feff819cdc9f',
:purge_config => false,
:nuage_default_allow_non_ip => false,}
end
shared_examples 'neutron plugin ml2 nuage' do
it { should contain_class('neutron::params') }
it 'configures neutron.conf' do
should contain_neutron_config('DEFAULT/core_plugin').with_value('ml2')
end
it 'passes purge to resource' do
should contain_resources('neutron_plugin_nuage').with({
:purge => false
})
end
it 'should have a nuage plugin ini file' do
should contain_file('/etc/neutron/plugins/nuage/plugin.ini').with(
:ensure => 'file',
:owner => 'root',
:group => 'neutron',
:mode => '0640'
)
end
it 'should configure plugin.ini' do
should contain_neutron_plugin_nuage('RESTPROXY/default_net_partition_name').with_value(params[:nuage_net_partition_name])
should contain_neutron_plugin_nuage('RESTPROXY/server').with_value(params[:nuage_vsd_ip])
should contain_neutron_plugin_nuage('RESTPROXY/serverauth')\
.with_value("#{params[:nuage_vsd_username]}:#{params[:nuage_vsd_password]}")\
.with_secret(true)
should contain_neutron_plugin_nuage('RESTPROXY/organization').with_value(params[:nuage_vsd_organization])
should contain_neutron_plugin_nuage('RESTPROXY/cms_id').with_value(params[:nuage_cms_id])
should contain_neutron_plugin_nuage('PLUGIN/default_allow_non_ip').with_value(params[:nuage_default_allow_non_ip])
end
context 'when allowing Non-IP' do
before :each do
params.merge!(:nuage_default_allow_non_ip => true)
end
it 'default_allow_non_ip is set to true' do
should contain_neutron_plugin_nuage('PLUGIN/default_allow_non_ip').with_value(true)
end
end
end
shared_examples 'neutron plugin ml2 nuage on Debian' do
it 'configures /etc/default/neutron-server' do
should contain_file_line('neutron-server-DAEMON_ARGS').with(
:path => '/etc/default/neutron-server',
:line => 'DAEMON_ARGS="$DAEMON_ARGS --config-file /etc/neutron/plugins/nuage/plugin.ini"',
:tag => 'neutron-file-line',
)
should contain_file_line('neutron-server-DAEMON_ARGS').that_requires('Anchor[neutron::config::begin]')
should contain_file_line('neutron-server-DAEMON_ARGS').that_notifies('Anchor[neutron::config::end]')
end
end
shared_examples 'neutron plugin ml2 nuage on RedHat' do
it 'should create plugin symbolic link' do
should contain_file('/etc/neutron/conf.d/neutron-server/nuage_plugin.conf').with(
:ensure => 'link',
:target => '/etc/neutron/plugins/nuage/plugin.ini',
:tag => 'neutron-config-file'
)
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'neutron plugin ml2 nuage'
it_behaves_like "neutron plugin ml2 nuage on #{facts[:os]['family']}"
end
end
end

View File

@ -1,42 +0,0 @@
require 'spec_helper'
provider_class = Puppet::Type.type(:neutron_plugin_nuage).provider(:ini_setting)
describe provider_class do
let(:resource ) do
Puppet::Type::Neutron_plugin_nuage.new({
:name => 'DEFAULT/foo',
:value => 'bar',
})
end
let (:provider) { resource.provider }
[ 'RedHat', 'Debian' ].each do |os|
context "on #{os} with default setting" do
it 'it should fall back to default and use plugin.ini' do
expect(provider.section).to eq('DEFAULT')
expect(provider.setting).to eq('foo')
expect(provider.file_path).to eq('/etc/neutron/plugins/nuage/plugin.ini')
end
end
end
it 'should ensure absent when <SERVICE DEFAULT> is specified as a value' do
resource = Puppet::Type::Neutron_plugin_nuage.new(
{:name => 'somename/foo', :value => '<SERVICE DEFAULT>'}
)
provider = provider_class.new(resource)
provider.exists?
expect(resource[:ensure]).to eq :absent
end
it 'should ensure absent when value matches ensure_absent_val' do
resource = Puppet::Type::Neutron_plugin_nuage.new(
{:name => 'somename/foo', :value => 'foo', :ensure_absent_val => 'foo' }
)
provider = provider_class.new(resource)
provider.exists?
expect(resource[:ensure]).to eq :absent
end
end