Deprecate neutron::plugins::cisco

This class was initially introduced to support Cisco monolithic plugins
but these plugins were removed and replaced by ml2 plugins.

Change-Id: I4cdc70ef2e0544db30b4ed7c24816accf074f860
This commit is contained in:
Takashi Kajinami 2021-01-02 18:26:12 +09:00
parent c87498ac3b
commit bc50622a2d
6 changed files with 32 additions and 333 deletions

View File

@ -69,15 +69,6 @@
# [*plugin_nvp_config*]
# (optional) Manage configuration of /etc/neutron/plugins/nicira/nvp.ini
#
# [*plugin_cisco_db_conn_config*]
# (optional) Manage configuration of plugins/cisco/db_conn.ini
#
# [*plugin_cisco_l2network_config*]
# (optional) Manage configuration of plugins/cisco/l2network_plugin.ini
#
# [*plugin_cisco_config*]
# (optional) Manage configuration of cisco_plugins.ini
#
# [*plugin_midonet_config*]
# (optional) Manage configuration of plugins/midonet/midonet.ini
#
@ -101,6 +92,15 @@
# [*api_config*]
# (optional) Manage configuration of api-paste.ini
#
# [*plugin_cisco_db_conn_config*]
# (optional) Manage configuration of plugins/cisco/db_conn.ini
#
# [*plugin_cisco_l2network_config*]
# (optional) Manage configuration of plugins/cisco/l2network_plugin.ini
#
# [*plugin_cisco_config*]
# (optional) Manage configuration of cisco_plugins.ini
#
# NOTE: The configuration MUST NOT be already handled by this module
# or Puppet catalog compilation will fail with duplicate resources.
#
@ -120,9 +120,6 @@ class neutron::config (
$vpnaas_agent_config = {},
$bgp_dragent_config = {},
$plugin_linuxbridge_config = {},
$plugin_cisco_db_conn_config = {},
$plugin_cisco_l2network_config = {},
$plugin_cisco_config = {},
$plugin_midonet_config = {},
$plugin_plumgrid_config = {},
$plugin_opencontrail_config = {},
@ -132,6 +129,9 @@ class neutron::config (
$plugin_nvp_config = {},
# DEPRECATED PARAMETERS
$api_config = undef,
$plugin_cisco_db_conn_config = undef,
$plugin_cisco_l2network_config = undef,
$plugin_cisco_config = undef,
) {
include neutron::deps
@ -144,6 +144,18 @@ will be removed in a future release. Use the api_paste_ini parameter instead.')
$api_paste_ini_real = $api_paste_ini
}
$cisco_plugin_param_names = [
'plugin_cisco_db_conn_config',
'plugin_cisco_l2network_config',
'plugin_cisco_config',
]
$cisco_plugin_param_names.each |$param_name| {
$param = getvar($param_name)
if $param != undef{
warning("The ${param_name} parameter is deprecated and has no effect.")
}
}
validate_legacy(Hash, 'validate_hash', $server_config)
validate_legacy(Hash, 'validate_hash', $api_paste_ini_real)
validate_legacy(Hash, 'validate_hash', $bgpvpn_bagpipe_config)
@ -159,9 +171,6 @@ will be removed in a future release. Use the api_paste_ini parameter instead.')
validate_legacy(Hash, 'validate_hash', $vpnaas_agent_config)
validate_legacy(Hash, 'validate_hash', $bgp_dragent_config)
validate_legacy(Hash, 'validate_hash', $plugin_linuxbridge_config)
validate_legacy(Hash, 'validate_hash', $plugin_cisco_db_conn_config)
validate_legacy(Hash, 'validate_hash', $plugin_cisco_l2network_config)
validate_legacy(Hash, 'validate_hash', $plugin_cisco_config)
validate_legacy(Hash, 'validate_hash', $plugin_midonet_config)
validate_legacy(Hash, 'validate_hash', $plugin_plumgrid_config)
validate_legacy(Hash, 'validate_hash', $plugin_opencontrail_config)
@ -183,9 +192,6 @@ will be removed in a future release. Use the api_paste_ini parameter instead.')
create_resources('neutron_vpnaas_agent_config', $vpnaas_agent_config)
create_resources('neutron_bgp_dragent_config', $bgp_dragent_config)
create_resources('neutron_plugin_linuxbridge', $plugin_linuxbridge_config)
create_resources('neutron_plugin_cisco_db_conn', $plugin_cisco_db_conn_config)
create_resources('neutron_plugin_cisco_l2network', $plugin_cisco_l2network_config)
create_resources('neutron_plugin_cisco', $plugin_cisco_config)
create_resources('neutron_plugin_midonet', $plugin_midonet_config)
create_resources('neutron_plugin_plumgrid', $plugin_plumgrid_config)
create_resources('neutron_plugin_opencontrail', $plugin_opencontrail_config)

View File

@ -65,7 +65,6 @@ class neutron::params {
$bigswitch_agent_package = 'openstack-neutron-bigswitch-agent'
$bigswitch_lldp_service = 'neutron-bsn-lldp'
$bigswitch_agent_service = 'neutron-bsn-agent'
$cisco_server_package = 'openstack-neutron-cisco'
$nvp_server_package = 'openstack-neutron-nicira'
$dhcp_agent_package = false
$metering_agent_package = 'openstack-neutron-metering-agent'
@ -119,7 +118,6 @@ class neutron::params {
$linuxbridge_server_package = 'neutron-plugin-linuxbridge'
$sriov_nic_agent_service = 'neutron-sriov-agent'
$sriov_nic_agent_package = 'neutron-sriov-agent'
$cisco_server_package = 'neutron-plugin-cisco'
$nvp_server_package = 'neutron-plugin-nicira'
$dhcp_agent_package = 'neutron-dhcp-agent'
$metering_agent_package = 'neutron-metering-agent'

View File

@ -1,5 +1,5 @@
#
# DEPRECATED !
# Configure the cisco neutron plugin
# More info available here:
# https://wiki.openstack.org/wiki/Cisco-neutron
@ -119,108 +119,7 @@ class neutron::plugins::cisco(
$max_networks = '65568',
$package_ensure = 'present',
$purge_config = false,
)
{
include neutron::deps
) {
ensure_resource('file', '/etc/neutron/plugins', {
ensure => directory,
owner => 'root',
group => 'neutron',
mode => '0640'}
)
ensure_resource('file', '/etc/neutron/plugins/cisco', {
ensure => directory,
owner => 'root',
group => 'neutron',
mode => '0640'}
)
if $::operatingsystem == 'Ubuntu' {
file_line { '/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG':
path => '/etc/default/neutron-server',
match => '^NEUTRON_PLUGIN_CONFIG=(.*)$',
line => "NEUTRON_PLUGIN_CONFIG=${::neutron::params::cisco_config_file}",
tag => 'neutron-file-line',
}
}
package { 'neutron-plugin-cisco':
ensure => $package_ensure,
name => $::neutron::params::cisco_server_package,
tag => ['neutron-support-package', 'openstack'],
}
# Setting purge for all configs
resources { 'neutron_plugin_cisco':
purge => $purge_config,
}
resources { 'neutron_plugin_cisco_db_conn':
purge => $purge_config,
}
resources { 'neutron_plugin_cisco_l2network':
purge => $purge_config,
}
resources { 'neutron_plugin_cisco_credentials':
purge => $purge_config,
}
neutron_plugin_cisco {
'PLUGINS/nexus_plugin' : value => $nexus_plugin;
}
if $vswitch_plugin {
neutron_plugin_cisco {
'PLUGINS/vswitch_plugin' : value => $vswitch_plugin;
}
}
# neutron-server will crash if the inventory section is empty.
# this is usually used for specifying which physical nexus
# devices are to be used.
neutron_plugin_cisco {
'INVENTORY/dummy' : value => 'dummy';
}
neutron_plugin_cisco_db_conn {
'DATABASE/name': value => $database_name;
'DATABASE/user': value => $database_user;
'DATABASE/pass': value => $database_pass;
'DATABASE/host': value => $database_host;
}
neutron_plugin_cisco_l2network {
'VLANS/vlan_start': value => $vlan_start;
'VLANS/vlan_end': value => $vlan_end;
'VLANS/vlan_name_prefix': value => $vlan_name_prefix;
'MODEL/model_class': value => $model_class;
'PORTS/max_ports': value => $max_ports;
'PORTPROFILES/max_port_profiles': value => $max_port_profiles;
'NETWORKS/max_networks': value => $max_networks;
'SEGMENTATION/manager_class': value => $manager_class;
}
neutron_plugin_cisco_credentials {
'keystone/username': value => $keystone_username;
'keystone/password': value => $keystone_password, secret => true;
'keystone/auth_url': value => $keystone_auth_url;
'keystone/tenant' : value => $keystone_tenant;
}
# In RH, this link is used to start Neutron process but in Debian, it's used only
# to manage database synchronization.
if defined(File['/etc/neutron/plugin.ini']) {
File <| path == '/etc/neutron/plugin.ini' |> { target => '/etc/neutron/plugins/cisco/cisco_plugins.ini' }
}
else {
file {'/etc/neutron/plugin.ini':
ensure => link,
target => '/etc/neutron/plugins/cisco/cisco_plugins.ini',
tag => 'neutron-config-file',
}
}
warning('Support for the Neutron Cisco plugin was deprecated and has no effect')
}

View File

@ -0,0 +1,5 @@
---
deprecations:
- |
The ``neutron::plugins::cisco`` class has been deprecated and has no effect
now.

View File

@ -114,9 +114,6 @@ describe 'neutron::config' do
let :params do
{
:plugin_linuxbridge_config => config_hash,
:plugin_cisco_db_conn_config => config_hash,
:plugin_cisco_l2network_config => config_hash,
:plugin_cisco_config => config_hash,
:plugin_midonet_config => config_hash,
:plugin_plumgrid_config => config_hash,
:plugin_nsx_config => config_hash,
@ -133,24 +130,6 @@ describe 'neutron::config' do
should contain_neutron_plugin_linuxbridge('DEFAULT/baz').with_ensure('absent')
end
it 'configures arbitrary neutron_plugin_cisco_db_conn configurations' do
should contain_neutron_plugin_cisco_db_conn('DEFAULT/foo').with_value('fooValue')
should contain_neutron_plugin_cisco_db_conn('DEFAULT/bar').with_value('barValue')
should contain_neutron_plugin_cisco_db_conn('DEFAULT/baz').with_ensure('absent')
end
it 'configures arbitrary neutron_plugin_cisco_l2network configurations' do
should contain_neutron_plugin_cisco_l2network('DEFAULT/foo').with_value('fooValue')
should contain_neutron_plugin_cisco_l2network('DEFAULT/bar').with_value('barValue')
should contain_neutron_plugin_cisco_l2network('DEFAULT/baz').with_ensure('absent')
end
it 'configures arbitrary neutron_plugin_cisco configurations' do
should contain_neutron_plugin_cisco('DEFAULT/foo').with_value('fooValue')
should contain_neutron_plugin_cisco('DEFAULT/bar').with_value('barValue')
should contain_neutron_plugin_cisco('DEFAULT/baz').with_ensure('absent')
end
it 'configures arbitrary neutron_plugin_midonet configurations' do
should contain_neutron_plugin_midonet('DEFAULT/foo').with_value('fooValue')
should contain_neutron_plugin_midonet('DEFAULT/bar').with_value('barValue')

View File

@ -1,188 +0,0 @@
require 'spec_helper'
describe 'neutron::plugins::cisco' do
let :pre_condition do
"class { 'neutron::keystone::authtoken':
password => 'passw0rd',
}
class { 'neutron::server': }
class { 'neutron': }"
end
let :params do
{
:keystone_username => 'neutron',
:keystone_password => 'neutron_pass',
:keystone_auth_url => 'http://127.0.0.1:5000/v3/',
:keystone_tenant => 'tenant',
:database_name => 'neutron',
:database_pass => 'dbpass',
:database_host => 'localhost',
:database_user => 'neutron'
}
end
let :params_default do
{
:vswitch_plugin => 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
:vlan_start => '100',
:vlan_end => '3000',
:vlan_name_prefix => 'q-',
:model_class => 'neutron.plugins.cisco.models.virt_phy_sw_v2.VirtualPhysicalSwitchModelV2',
:max_ports => '100',
:max_port_profiles => '65568',
:max_networks => '65568',
:manager_class => 'neutron.plugins.cisco.segmentation.l2network_vlan_mgr_v2.L2NetworkVLANMgr',
:purge_config => false,
}
end
shared_examples 'default cisco plugin' do
before do
params.merge!(params_default)
end
it 'should create plugin symbolic link' do
should contain_file('/etc/neutron/plugin.ini').with(
:ensure => 'link',
:target => '/etc/neutron/plugins/cisco/cisco_plugins.ini',
)
should contain_file('/etc/neutron/plugin.ini').that_requires('Anchor[neutron::config::begin]')
should contain_file('/etc/neutron/plugin.ini').that_notifies('Anchor[neutron::config::end]')
end
it 'should have a plugin config folder' do
should contain_file('/etc/neutron/plugins').with(
:ensure => 'directory',
:owner => 'root',
:group => 'neutron',
:mode => '0640'
)
end
it 'should have a cisco plugin config folder' do
should contain_file('/etc/neutron/plugins/cisco').with(
:ensure => 'directory',
:owner => 'root',
:group => 'neutron',
:mode => '0640'
)
end
it 'passes purge to resource plugin_cisco' do
should contain_resources('neutron_plugin_cisco').with({
:purge => false
})
end
it 'passes purge to resource cisco_db_conn' do
should contain_resources('neutron_plugin_cisco_db_conn').with({
:purge => false
})
end
it 'passes purge to resource cisco_l2network' do
should contain_resources('neutron_plugin_cisco_l2network').with({
:purge => false
})
end
it 'passes purge to resource cisco_credentials' do
should contain_resources('neutron_plugin_cisco_credentials').with({
:purge => false
})
end
it 'should perform default l2 configuration' do
should contain_neutron_plugin_cisco_l2network('VLANS/vlan_start').\
with_value(params[:vlan_start])
should contain_neutron_plugin_cisco_l2network('VLANS/vlan_end').\
with_value(params[:vlan_end])
should contain_neutron_plugin_cisco_l2network('VLANS/vlan_name_prefix').\
with_value(params[:vlan_name_prefix])
should contain_neutron_plugin_cisco_l2network('MODEL/model_class').\
with_value(params[:model_class])
should contain_neutron_plugin_cisco_l2network('PORTS/max_ports').\
with_value(params[:max_ports])
should contain_neutron_plugin_cisco_l2network('PORTPROFILES/max_port_profiles').\
with_value(params[:max_port_profiles])
should contain_neutron_plugin_cisco_l2network('NETWORKS/max_networks').\
with_value(params[:max_networks])
should contain_neutron_plugin_cisco_l2network('SEGMENTATION/manager_class').\
with_value(params[:manager_class])
end
it 'should create a dummy inventory item' do
should contain_neutron_plugin_cisco('INVENTORY/dummy').\
with_value('dummy')
end
it 'should configure the db connection' do
should contain_neutron_plugin_cisco_db_conn('DATABASE/name').\
with_value(params[:database_name])
should contain_neutron_plugin_cisco_db_conn('DATABASE/user').\
with_value(params[:database_user])
should contain_neutron_plugin_cisco_db_conn('DATABASE/pass').\
with_value(params[:database_pass])
should contain_neutron_plugin_cisco_db_conn('DATABASE/host').\
with_value(params[:database_host])
end
it 'should configure the admin credentials' do
should contain_neutron_plugin_cisco_credentials('keystone/username').\
with_value(params[:keystone_username])
should contain_neutron_plugin_cisco_credentials('keystone/password').\
with_value(params[:keystone_password])
should contain_neutron_plugin_cisco_credentials('keystone/password').with_secret( true )
should contain_neutron_plugin_cisco_credentials('keystone/auth_url').\
with_value(params[:keystone_auth_url])
should contain_neutron_plugin_cisco_credentials('keystone/tenant').\
with_value(params[:keystone_tenant])
end
it 'should perform vswitch plugin configuration' do
should contain_neutron_plugin_cisco('PLUGINS/vswitch_plugin').\
with_value('neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2')
end
describe 'with nexus plugin' do
before do
params.merge!(:nexus_plugin => 'neutron.plugins.cisco.nexus.cisco_nexus_plugin_v2.NexusPlugin')
end
it 'should perform nexus plugin configuration' do
should contain_neutron_plugin_cisco('PLUGINS/nexus_plugin').\
with_value('neutron.plugins.cisco.nexus.cisco_nexus_plugin_v2.NexusPlugin')
end
end
end
shared_examples 'neutron::plugins::cisco on Ubuntu' do
it 'configures /etc/default/neutron-server' do
should contain_file_line('/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG').with(
:path => '/etc/default/neutron-server',
:match => '^NEUTRON_PLUGIN_CONFIG=(.*)$',
:line => 'NEUTRON_PLUGIN_CONFIG=/etc/neutron/plugins/cisco/cisco_plugins.ini',
:tag => 'neutron-file-line',
)
should contain_file_line('/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG').that_requires('Anchor[neutron::config::begin]')
should contain_file_line('/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG').that_notifies('Anchor[neutron::config::end]')
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 'default cisco plugin'
if facts[:operatingsystem] == 'Ubuntu'
it_behaves_like 'neutron::plugins::cisco on Ubuntu'
end
end
end
end