Support networking-baremetal in Ubuntu/Debian

The required packages are already built and provided for these distros.

Change-Id: I7f0d453b9a3309af346e2d77672124ce064afad6
This commit is contained in:
Takashi Kajinami 2022-03-28 00:56:54 +09:00
parent 989282da3b
commit 5c09c4f6ca
6 changed files with 60 additions and 70 deletions

View File

@ -147,11 +147,6 @@ class neutron::agents::ml2::networking_baremetal (
include neutron::deps
include neutron::params
if($::osfamily != 'RedHat') {
# Drivers are only packaged for RedHat at this time
fail("Unsupported osfamily ${::osfamily}")
}
resources { 'ironic_neutron_agent_config':
purge => $purge_config,
}

View File

@ -115,6 +115,9 @@ class neutron::params {
$ovn_metadata_agent_package = 'neutron-ovn-metadata-agent'
$neutron_wsgi_script_path = '/usr/lib/cgi-bin/neutron'
$neutron_wsgi_script_source = '/usr/bin/neutron-api'
$networking_baremetal_package = 'python3-ironic-neutron-agent'
$networking_baremetal_agent_package = 'ironic-neutron-agent'
$networking_baremetal_agent_service = 'ironic-neutron-agent'
$mlnx_agent_service = 'neutron-plugin-mlnx-agent'
} else {
fail("Unsupported osfamily ${::osfamily}")

View File

@ -17,14 +17,9 @@ class neutron::plugins::ml2::networking_baremetal(
include neutron::deps
include neutron::params
if($::osfamily != 'RedHat') {
# Drivers are only packaged for RedHat at this time
fail("Unsupported osfamily ${::osfamily}")
} else {
package { 'python-networking-baremetal':
ensure => $package_ensure,
name => $::neutron::params::networking_baremetal_package,
tag => ['openstack', 'neutron-plugin-ml2-package'],
}
}
}

View File

@ -0,0 +1,5 @@
---
features:
- |
Now this module supports configuration of networking-baremetal in Debian
and Ubuntu. Previously it was supported in RHEL/CentOS only.

View File

@ -22,7 +22,7 @@ describe 'neutron::agents::ml2::networking_baremetal' do
}
end
shared_examples 'networking-baremetal ironic-neutron-agent with ml2 plugin' do
shared_examples 'neutron::agents::ml2::networking_baremetal' do
let :p do
default_params.merge(params)
end
@ -124,21 +124,19 @@ describe 'neutron::agents::ml2::networking_baremetal' do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
let (:platform_params) do
case facts[:osfamily]
when 'Debian'
{ :networking_baremetal_agent_package => 'ironic-neutron-agent',
:networking_baremetal_agent_service => 'ironic-neutron-agent' }
when 'RedHat'
{ :networking_baremetal_agent_package => 'python3-ironic-neutron-agent',
:networking_baremetal_agent_service => 'ironic-neutron-agent' }
end
end
case facts[:osfamily]
when 'RedHat'
it_behaves_like 'networking-baremetal ironic-neutron-agent with ml2 plugin'
when facts[:osfamily] != 'RedHat'
it 'fails with unsupported osfamily' do
should raise_error(Puppet::Error, /Unsupported osfamily.*/)
end
end
it_behaves_like 'neutron::agents::ml2::networking_baremetal'
end
end
end

View File

@ -39,19 +39,13 @@ describe 'neutron::plugins::ml2::networking_baremetal' do
let (:platform_params) do
case facts[:osfamily]
when 'Debian'
{ :networking_baremetal_package => 'python3-networking-baremetal'}
{ :networking_baremetal_package => 'python3-ironic-neutron-agent'}
when 'RedHat'
{ :networking_baremetal_package => 'python3-networking-baremetal'}
end
end
case facts[:osfamily]
when 'RedHat'
it_behaves_like 'networking-baremetal ml2 plugin'
when facts[:osfamily] != 'RedHat'
it 'fails with unsupported osfamily' do
should raise_error(Puppet::Error, /Unsupported osfamily.*/)
end
end
end
end
end