Remove networking-mlnx support

... which was deprecated during the previous cycle[1].

[1] 98ea1311fb

Change-Id: I2c5f180dd124983f3ab9dc429c6ea69c95f20ab4
This commit is contained in:
Takashi Kajinami 2024-04-19 10:58:13 +09:00
parent 21474f02ba
commit 0e3f4a0eb3
12 changed files with 0 additions and 607 deletions

View File

@ -1,10 +0,0 @@
Puppet::Type.type(:eswitchd_config).provide(
:ini_setting,
:parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
) do
def self.file_path
'/etc/neutron/plugins/ml2/eswitchd.conf'
end
end

View File

@ -1,10 +0,0 @@
Puppet::Type.type(:neutron_mlnx_agent_config).provide(
:ini_setting,
:parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
) do
def self.file_path
'/etc/neutron/plugins/mlnx/mlnx_conf.ini'
end
end

View File

@ -1,27 +0,0 @@
Puppet::Type.newtype(:eswitchd_config) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from /etc/neutron/plugins/ml2/eswitchd.conf'
newvalues(/\S+\/\S+/)
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
newproperty(:value) do
desc 'The value of the setting to be defined.'
munge do |value|
value = value.to_s.strip
value.capitalize! if value =~ /^(true|false)$/i
value
end
end
end

View File

@ -1,27 +0,0 @@
Puppet::Type.newtype(:neutron_mlnx_agent_config) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from /etc/neutron/plugins/mlnx/mlnx_conf.ini'
newvalues(/\S+\/\S+/)
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
newproperty(:value) do
desc 'The value of the setting to be defined.'
munge do |value|
value = value.to_s.strip
value.capitalize! if value =~ /^(true|false)$/i
value
end
end
end

View File

@ -1,144 +0,0 @@
#
# == Class: neutron::agents::ml2::mlnx
#
# DEPRECATED !
# Setups MLNX neutron agent when using ML2 plugin
#
# === Parameters
#
# [*package_ensure*]
# (optional) The state of the package
# Defaults to 'present'
#
# [*enabled*]
# (required) Whether or not to enable the MLNX Agent
# Defaults to true
#
# [*manage_service*]
# (optional) Whether to start/stop the service
# Defaults to true
#
# [*manage_package*]
# (optional) Whether to install the package
# Defaults to true
#
# [*physical_interface_mappings*]
# (optional) Array of <physical_network>:<physical device>
# All physical networks listed in network_vlan_ranges
# on the server should have mappings to appropriate
# interfaces on each agent.
# Value should be of type array, Defaults to $facts['os_service_default']
#
# [*polling_interval*]
# (optional) The number of seconds the agent will wait between
# polling for local device changes.
# Defaults to $facts['os_service_default']
#
# [*multi_interface_driver_mappings*]
# (optional) A per physnet interface driver mapping used by
# multidriver interface driver to manage the virtual
# interface per physnet. a virtual network e.g vxlan
# will map to the 'nil' physnet.
# Defaults to $facts['os_service_default']
#
# [*ipoib_physical_interface*]
# (optional) Name of the IPoIB root device to use with
# ipoib interface driver.
# Defaults to $facts['os_service_default']
#
# [*enable_multi_interface_driver_cache_maintenance*]
# (optional) Enable periodic job to perform maintenance to the
# embedded network cache for multi interface driver.
# Set to true if a multi interface driver instance will
# be active for an extended amount of time.
# Defaults to false
#
class neutron::agents::ml2::mlnx (
$package_ensure = 'present',
Boolean $enabled = true,
Boolean $manage_service = true,
Boolean $manage_package = true,
$physical_interface_mappings = $facts['os_service_default'],
$polling_interval = $facts['os_service_default'],
$multi_interface_driver_mappings = $facts['os_service_default'],
$ipoib_physical_interface = $facts['os_service_default'],
$enable_multi_interface_driver_cache_maintenance = false,
) {
warning('Support for networking-mlnx has been deprecated')
include neutron::deps
include neutron::params
$mlnx_agent_package = $::neutron::params::mlnx_agent_package
$mlnx_agent_service = $::neutron::params::mlnx_agent_service
$eswitchd_package = $::neutron::params::eswitchd_package
$eswitchd_service = $::neutron::params::eswitchd_service
$mlnx_plugin_package = $::neutron::params::mlnx_plugin_package
neutron_mlnx_agent_config {
'eswitch/physical_interface_mappings': value => pick(join(any2array($physical_interface_mappings), ','), $facts['os_service_default']);
'agent/polling_interval' : value => $polling_interval;
}
eswitchd_config {
'DAEMON/fabrics': value => pick(join(any2array($physical_interface_mappings), ','), $facts['os_service_default']);
}
$mappings_array = pick(join(any2array($multi_interface_driver_mappings), ','), $facts['os_service_default']);
neutron_dhcp_agent_config {
'DEFAULT/multi_interface_driver_mappings' : value => $mappings_array;
'DEFAULT/ipoib_physical_interface' : value => $ipoib_physical_interface;
'DEFAULT/enable_multi_interface_driver_cache_maintenance' : value => $enable_multi_interface_driver_cache_maintenance;
}
neutron_l3_agent_config {
'DEFAULT/multi_interface_driver_mappings' : value => $mappings_array;
'DEFAULT/ipoib_physical_interface' : value => $ipoib_physical_interface;
'DEFAULT/enable_multi_interface_driver_cache_maintenance' : value => $enable_multi_interface_driver_cache_maintenance;
}
if $manage_package {
if $mlnx_agent_package != $mlnx_plugin_package {
$mlnx_agent_package_tag = ['openstack', 'neutron-package']
} else {
$mlnx_agent_package_tag = ['openstack', 'neutron-plugin-ml2-package']
Package[$mlnx_agent_package] -> Neutron_mlnx_agent_config<||>
}
ensure_packages($mlnx_agent_package, {
ensure => $package_ensure,
tag => $mlnx_agent_package_tag,
})
# NOTE(tkajinam): Ubuntu/Debian requires a separate package for eswitchd
# service.
if $eswitchd_package {
ensure_packages($eswitchd_package, {
ensure => $package_ensure,
tag => ['openstack', 'neutron-package'],
})
}
}
if $manage_service {
if $enabled {
$service_ensure = 'running'
} else {
$service_ensure = 'stopped'
}
service { $mlnx_agent_service:
ensure => $service_ensure,
name => $mlnx_agent_service,
enable => $enabled,
tag => 'neutron-service',
}
service { $eswitchd_service:
ensure => $service_ensure,
name => $eswitchd_service,
enable => $enabled,
tag => 'neutron-service',
}
}
}

View File

@ -64,11 +64,6 @@ class neutron::params {
$networking_baremetal_package = 'python3-networking-baremetal'
$networking_baremetal_agent_package = 'python3-ironic-neutron-agent'
$networking_baremetal_agent_service = 'ironic-neutron-agent'
$mlnx_agent_package = 'python3-networking-mlnx'
$mlnx_plugin_package = 'python3-networking-mlnx'
$eswitchd_package = undef
$mlnx_agent_service = 'neutron-mlnx-agent'
$eswitchd_service = 'eswitchd'
}
'Debian': {
$package_name = 'neutron-common'
@ -120,11 +115,6 @@ class neutron::params {
$networking_baremetal_package = 'python3-ironic-neutron-agent'
$networking_baremetal_agent_package = 'ironic-neutron-agent'
$networking_baremetal_agent_service = 'ironic-neutron-agent'
$mlnx_agent_package = 'neutron-mlnx-agent'
$mlnx_plugin_package = 'python3-networking-mlnx'
$eswitchd_package = 'networking-mlnx-eswitchd'
$mlnx_agent_service = 'neutron-mlnx-agent'
$eswitchd_service = 'networking-mlnx-eswitchd'
}
default: {
fail("Unsupported osfamily: ${facts['os']['family']}")

View File

@ -1,32 +0,0 @@
#
# == Class: neutron::plugins::ml2::mellanox
#
# DEPRECATED !
# Install the Mellanox plugins and generate the config file
# from parameters in the other classes.
#
# === Parameters
#
# [*package_ensure*]
# (optional) The intended state of the networking-mlnx
# package, i.e. any of the possible values of the 'ensure'
# property for a package resource type.
# Defaults to 'present'
#
class neutron::plugins::ml2::mellanox (
$package_ensure = 'present'
) {
warning('Support for networking-mlnx has been deprecated')
include neutron::deps
include neutron::params
require neutron::plugins::ml2
$mlnx_plugin_package = $::neutron::params::mlnx_plugin_package
ensure_packages($mlnx_plugin_package, {
ensure => $package_ensure,
tag => ['openstack', 'neutron-plugin-ml2-package'],
})
}

View File

@ -1,63 +0,0 @@
#
# == Class: neutron::plugins::ml2::mellanox::mlnx_sdn_assist
#
# DEPRECATED !
# Install the OpenDaylight and generate config file
# from parameters in the other classes.
#
# === Parameters
#
# [*sdn_token*]
# (optional) The Mellanox controller token
# Defaults to $facts['os_service_default']
# Example: 'abcdef'
#
# [*sdn_url*]
# (optional) The Mellanox controller neutron URL
# Defaults to $facts['os_service_default']
# Example: 'http://127.0.0.1/ufmRestV3/'
#
# [*sdn_domain*]
# (optional) The Mellanox controller domain
# Defaults to $facts['os_service_default']
# Example: 'cloudx'
#
# [*sync_enabled*]
# (optional) Whether synchronising state to an
# SDN provider is enabled.
# Defaults to true
#
# [*bind_normal_ports*]
# (optional) Allow the binding of normal ports for ports
# associated with a physnet from bind_normal_ports_physnets
# Defaults to false
#
# [*bind_normal_ports_physnets*]
# (optional) A list of physnets in which binding of normal
# ports is allowed. This option is used in conjunction
# with bind_normal_ports.
# The list must be a subset of physical_networks
# Defaults to []
#
class neutron::plugins::ml2::mellanox::mlnx_sdn_assist (
$sdn_token = $facts['os_service_default'],
$sdn_url = $facts['os_service_default'],
$sdn_domain = $facts['os_service_default'],
$sync_enabled = true,
$bind_normal_ports = false,
$bind_normal_ports_physnets = [],
) {
warning('Support for networking-mlnx has been deprecated')
include neutron::deps
require neutron::plugins::ml2
neutron_plugin_ml2 {
'sdn/token': value => $sdn_token, secret => true;
'sdn/url': value => $sdn_url;
'sdn/domain': value => $sdn_domain;
'sdn/sync_enabled': value => $sync_enabled;
'sdn/bind_normal_ports': value => $bind_normal_ports;
'sdn/bind_normal_ports_physnets': value => $bind_normal_ports_physnets;
}
}

View File

@ -1,129 +0,0 @@
require 'spec_helper'
describe 'neutron::agents::ml2::mlnx' do
let :pre_condition do
"class { 'neutron': }"
end
let :params do
{}
end
shared_examples 'neutron mlnx agent with ml2 plugin' do
it { should contain_class('neutron::params') }
it 'configures /etc/neutron/plugins/mlnx/mlnx_config.ini' do
should contain_neutron_mlnx_agent_config('eswitch/physical_interface_mappings').with_value('<SERVICE DEFAULT>')
end
it 'installs neutron mlnx agent package' do
should contain_package(platform_params[:mlnx_agent_package]).with(
:name => platform_params[:mlnx_agent_package],
:ensure => 'installed',
:tag => platform_params[:mlnx_agent_package_tag]
)
if platform_params[:eswitchd_package]
should contain_package(platform_params[:eswitchd_package]).with(
:name => platform_params[:eswitchd_package],
:ensure => 'installed',
:tag => ['openstack', 'neutron-package'],
)
end
end
it 'configures neutron mlnx agent service' do
should contain_service(platform_params[:mlnx_agent_service]).with(
:name => platform_params[:mlnx_agent_service],
:enable => true,
:ensure => 'running',
:tag => 'neutron-service',
)
should contain_service(platform_params[:eswitchd_service]).with(
:name => platform_params[:eswitchd_service],
:enable => true,
:ensure => 'running',
:tag => 'neutron-service',
)
end
context 'with manage_service as false' do
before :each do
params.merge!(:manage_service => false)
end
it 'should not manage the services' do
should_not contain_service(platform_params[:mlnx_agent_service])
should_not contain_service(platform_params[:eswitchd_service])
end
end
context 'when supplying device mapping' do
before :each do
params.merge!(:physical_interface_mappings => ['physnet1:eth1'])
end
it 'configures physical device mappings' do
should contain_neutron_mlnx_agent_config('eswitch/physical_interface_mappings').with_value(['physnet1:eth1'])
should contain_eswitchd_config('DAEMON/fabrics').with_value(['physnet1:eth1'])
end
end
context 'when supplying empty device mapping' do
before :each do
params.merge!(:physical_interface_mappings => "")
end
it 'configures physical device mappings with exclusion' do
should contain_neutron_mlnx_agent_config('eswitch/physical_interface_mappings').with_value('<SERVICE DEFAULT>')
should contain_eswitchd_config('DAEMON/fabrics').with_value('<SERVICE DEFAULT>')
end
end
it 'configures neutron dhcp agent' do
should contain_neutron_dhcp_agent_config('DEFAULT/multi_interface_driver_mappings').with_value('<SERVICE DEFAULT>')
should contain_neutron_dhcp_agent_config('DEFAULT/ipoib_physical_interface').with_value('<SERVICE DEFAULT>')
should contain_neutron_dhcp_agent_config('DEFAULT/enable_multi_interface_driver_cache_maintenance').with_value(false)
end
it 'configures neutron l3 agent' do
should contain_neutron_l3_agent_config('DEFAULT/multi_interface_driver_mappings').with_value('<SERVICE DEFAULT>')
should contain_neutron_l3_agent_config('DEFAULT/ipoib_physical_interface').with_value('<SERVICE DEFAULT>')
should contain_neutron_l3_agent_config('DEFAULT/enable_multi_interface_driver_cache_maintenance').with_value(false)
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
let (:platform_params) do
case facts[:os]['family']
when 'Debian'
{
:mlnx_agent_package => 'neutron-mlnx-agent',
:mlnx_agent_service => 'neutron-mlnx-agent',
:eswitchd_package => 'networking-mlnx-eswitchd',
:eswitchd_service => 'networking-mlnx-eswitchd',
:mlnx_agent_package_tag => ['openstack', 'neutron-package'],
}
when 'RedHat'
{
:mlnx_agent_package => 'python3-networking-mlnx',
:mlnx_agent_service => 'neutron-mlnx-agent',
:eswitchd_package => false,
:eswitchd_service => 'eswitchd',
:mlnx_agent_package_tag => ['openstack', 'neutron-plugin-ml2-package'],
}
end
end
it_behaves_like 'neutron mlnx agent with ml2 plugin'
end
end
end

View File

@ -1,53 +0,0 @@
require 'spec_helper'
describe 'neutron::plugins::ml2::mellanox' do
let :pre_condition do
"class { 'neutron::keystone::authtoken':
password => 'passw0rd',
}
class { 'neutron::server': }
class { 'neutron':
core_plugin => 'neutron.plugins.ml2.plugin.Ml2Plugin'
}"
end
let :params do
{}
end
shared_examples 'neutron plugin mellanox ml2' do
it { should contain_class('neutron::params') }
it 'should have' do
should contain_package(platform_params[:mlnx_plugin_package]).with(
:ensure => 'installed',
:tag => ['openstack', 'neutron-plugin-ml2-package']
)
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
let (:platform_params) do
case facts[:os]['family']
when 'Debian'
{
:mlnx_plugin_package => 'python3-networking-mlnx',
}
when 'RedHat'
{
:mlnx_plugin_package => 'python3-networking-mlnx',
}
end
end
it_behaves_like 'neutron plugin mellanox ml2'
end
end
end

View File

@ -1,51 +0,0 @@
require 'spec_helper'
describe 'neutron::plugins::ml2::mellanox::mlnx_sdn_assist' do
let :pre_condition do
"class { 'neutron::keystone::authtoken':
password => 'passw0rd',
}
class { 'neutron::server': }
class { 'neutron':
core_plugin => 'ml2'
}"
end
let :default_params do
{
:sdn_url => '<SERVICE DEFAULT>',
}
end
let :params do
{
:sdn_token => 'token',
}
end
shared_examples 'neutron plugin mellanox ml2 mlnx_sdn_assist' do
before do
params.merge!(default_params)
end
it 'configures sdn settings' do
should contain_neutron_plugin_ml2('sdn/token').with_value(params[:sdn_token]).with_secret(true)
should contain_neutron_plugin_ml2('sdn/url').with_value(params[:sdn_url])
should contain_neutron_plugin_ml2('sdn/sync_enabled').with_value('true')
should contain_neutron_plugin_ml2('sdn/bind_normal_ports').with_value('false')
should contain_neutron_plugin_ml2('sdn/bind_normal_ports_physnets').with_value([])
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 mellanox ml2 mlnx_sdn_assist'
end
end
end

View File

@ -1,51 +0,0 @@
require 'spec_helper'
provider_class = Puppet::Type.type(:neutron_mlnx_agent_config).provider(:ini_setting)
describe provider_class do
it 'should default to the default setting when no other one is specified' do
resource = Puppet::Type::Neutron_mlnx_agent_config.new(
{
:name => 'DEFAULT/foo',
:value => 'bar'
}
)
provider = provider_class.new(resource)
expect(provider.section).to eq('DEFAULT')
expect(provider.setting).to eq('foo')
expect(provider.file_path).to eq('/etc/neutron/plugins/mlnx/mlnx_conf.ini')
end
it 'should allow setting to be set explicitly' do
resource = Puppet::Type::Neutron_mlnx_agent_config.new(
{
:name => 'dude/foo',
:value => 'bar'
}
)
provider = provider_class.new(resource)
expect(provider.section).to eq('dude')
expect(provider.setting).to eq('foo')
expect(provider.file_path).to eq('/etc/neutron/plugins/mlnx/mlnx_conf.ini')
end
it 'should ensure absent when <SERVICE DEFAULT> is specified as a value' do
resource = Puppet::Type::Neutron_mlnx_agent_config.new(
{:name => 'dude/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_mlnx_agent_config.new(
{:name => 'dude/foo', :value => 'foo', :ensure_absent_val => 'foo' }
)
provider = provider_class.new(resource)
provider.exists?
expect(resource[:ensure]).to eq :absent
end
end