Browse Source

Drop support for FreeBSD and Solaris

These two distros are never tested in gate, and there are almost no
activities to keep these support updated for a while.

Change-Id: I6110cd9a62f33e2d046fc2c835aaec73c4532889
changes/81/787881/1
Takashi Kajinami 5 months ago
parent
commit
b91243937e
  1. 25
      lib/puppet/provider/vs_bridge/ovs.rb
  2. 6
      manifests/ovs.pp
  3. 16
      manifests/params.pp
  4. 14
      metadata.json
  5. 158
      spec/classes/vswitch_ovs_spec.rb

25
lib/puppet/provider/vs_bridge/ovs.rb

@ -1,14 +1,8 @@
require 'puppet'
Puppet::Type.type(:vs_bridge).provide(:ovs) do
commands :vsctl => 'ovs-vsctl'
if Facter.value(:operatingsystem) == 'FreeBSD'
commands :ifconfig => 'ifconfig'
elsif Facter.value(:operatingsystem) == 'Solaris'
commands :ipadm => '/usr/sbin/ipadm'
else
commands :ip => 'ip'
end
commands :vsctl => 'ovs-vsctl'
commands :ip => 'ip'
def exists?
vsctl("br-exists", @resource[:name])
@ -18,23 +12,12 @@ Puppet::Type.type(:vs_bridge).provide(:ovs) do
def create
vsctl('add-br', @resource[:name])
if Facter.value(:operatingsystem) == 'FreeBSD'
vsctl('set','bridge',@resource[:name],'datapath_type=netdev')
ifconfig(@resource[:name],'up')
elsif Facter.value(:operatingsystem) == 'Solaris'
ipadm('create-ip', @resource[:name])
else
ip('link', 'set', 'dev', @resource[:name], 'up')
end
ip('link', 'set', 'dev', @resource[:name], 'up')
external_ids = @resource[:external_ids] if @resource[:external_ids]
end
def destroy
if Facter.value(:operatingsystem) == 'FreeBSD'
ifconfig(@resource[:name],'down')
else
ip('link', 'set', 'dev', @resource[:name], 'down')
end
ip('link', 'set', 'dev', @resource[:name], 'down')
vsctl('del-br', @resource[:name])
end

6
manifests/ovs.pp

@ -45,7 +45,6 @@ class vswitch::ovs(
case $::osfamily {
'Debian': {
if $dkms_ensure {
package { $::vswitch::params::ovs_dkms_package_name:
ensure => $package_ensure,
@ -74,11 +73,6 @@ class vswitch::ovs(
}
}
'FreeBSD': {
Package {
provider => 'pkgng',
}
}
default: {
# to appease the lint gods.
}

16
manifests/params.pp

@ -49,22 +49,6 @@ class vswitch::params {
}
}
}
'FreeBSD': {
$ovs_package_name = 'openvswitch'
$ovs_pkg_provider = 'pkgng'
$provider = 'ovs'
$ovs_service_name = 'ovs-vswitchd'
$ovsdb_service_name = 'ovsdb-server'
$ovs_status = "/usr/sbin/service ${ovs_service_name} onestatus"
$ovsdb_status = "/usr/sbin/service ${ovsdb_service_name} onestatus"
}
'Solaris': {
$ovs_package_name = 'service/network/openvswitch'
$ovs_service_name = 'application/openvswitch/vswitch-server:default'
$ovsdb_service_name = 'application/openvswitch/ovsdb-server:default'
$ovs_status = "/usr/bin/svcs -H -o state ${ovs_service_name} | grep online"
$ovsdb_status = "/usr/bin/svcs -H -o state ${ovsdb_service_name} | grep online"
}
default: {
fail " Osfamily ${::osfamily} not supported yet"
}

14
metadata.json

@ -43,20 +43,6 @@
"operatingsystemrelease": [
"20.04"
]
},
{
"operatingsystem": "FreeBSD",
"operatingsystemrelease": [
"10.0",
"11.0"
]
},
{
"operatingsystem": "Solaris",
"operatingsystemrelease": [
"11.3",
"12.0"
]
}
],
"project_page": "https://launchpad.net/puppet-vswitch",

158
spec/classes/vswitch_ovs_spec.rb

@ -10,30 +10,6 @@ describe 'vswitch::ovs' do
}
end
let :freebsd_platform_params do {
:ovs_package_name => 'openvswitch',
:ovs_service_name => 'ovs-vswitchd',
:ovsdb_service_name => 'ovsdb-server',
:provider => 'ovs',
:service_hasstatus => nil,
:ovsdb_hasstatus => nil,
:service_status => '/usr/sbin/service ovs-vswitchd onestatus',
:ovsdb_status => '/usr/sbin/service ovsdb-server onestatus',
}
end
let :solaris_platform_params do {
:ovs_package_name => 'service/network/openvswitch',
:ovs_service_name => 'application/openvswitch/vswitch-server:default',
:ovsdb_service_name => 'application/openvswitch/ovsdb-server:default',
:provider => 'ovs',
:service_hasstatus => nil,
:ovsdb_hasstatus => nil,
:service_status => '/usr/bin/svcs -H -o state application/openvswitch/vswitch-server:default | grep online',
:ovsdb_status => '/usr/bin/svcs -H -o state application/openvswitch/ovsdb-server:default | grep online',
}
end
shared_examples_for 'vswitch::ovs' do
context 'default parameters' do
let (:params) { default_params }
@ -163,140 +139,6 @@ describe 'vswitch::ovs' do
end
end
context 'on FreeBSD with default parameters' do
let :params do default_params end
let :facts do
OSDefaults.get_facts({
:os => {
:family => 'FreeBSD',
:name => 'FreeBSD',
:release => { :major => '12' }
},
:osfamily => 'FreeBSD',
:operatingsystem => 'FreeBSD',
:ovs_version => '1.4.2',
})
end
let :platform_params do freebsd_platform_params end
it_configures 'vswitch::ovs'
it_configures 'do not install dkms'
it 'configures ovsdb service' do
is_expected.to contain_service('ovsdb-server').with(
:ensure => true,
:enable => true,
:name => platform_params[:ovsdb_service_name],
:hasstatus => platform_params[:ovsdb_hasstatus],
:status => platform_params[:ovsdb_status],
)
end
end
context 'on FreeBSD with parameters' do
let :params do {
:package_ensure => 'latest',
}
end
let :facts do
OSDefaults.get_facts({
:os => {
:family => 'FreeBSD',
:name => 'FreeBSD',
:release => { :major => '12' }
},
:osfamily => 'FreeBSD',
:operatingsystem => 'FreeBSD',
:ovs_version => '1.4.2',
})
end
let :platform_params do freebsd_platform_params end
it_configures 'vswitch::ovs'
it_configures 'do not install dkms'
it 'configures ovsdb service' do
is_expected.to contain_service(platform_params[:ovsdb_service_name]).with(
:ensure => true,
:enable => true,
:name => platform_params[:ovsdb_service_name],
:hasstatus => platform_params[:ovsdb_hasstatus],
:status => platform_params[:ovsdb_status],
)
end
it 'ovs-vswitchd requires ovsdb-server' do
is_expected.to contain_service(platform_params[:ovsdb_service_name]).that_notifies("Service[#{platform_params[:ovs_package_name]}]")
end
end
context 'on Solaris with default parameters' do
let :params do default_params end
let :facts do
OSDefaults.get_facts({
:os => {
:family => 'Solaris',
:name => 'Solaris',
:release => { :major => '11' }
},
:osfamily => 'Solaris',
:operatingsystem => 'Solaris',
:ovs_version => '2.3.1',
})
end
let :platform_params do solaris_platform_params end
it_configures 'vswitch::ovs'
it_configures 'do not install dkms'
it 'configures ovsdb service' do
is_expected.to contain_service('ovsdb-server').with(
:ensure => true,
:enable => true,
:name => platform_params[:ovsdb_service_name],
:hasstatus => platform_params[:ovsdb_hasstatus],
:status => platform_params[:ovsdb_status],
)
end
end
context 'on Solaris with parameters' do
let :params do {
:package_ensure => 'latest',
}
end
let :facts do
OSDefaults.get_facts({
:os => {
:family => 'Solaris',
:name => 'Solaris',
:release => { :major => '11' }
},
:osfamily => 'Solaris',
:operatingsystem => 'Solaris',
:ovs_version => '2.3.1',
})
end
let :platform_params do solaris_platform_params end
it_configures 'vswitch::ovs'
it_configures 'do not install dkms'
it 'configures ovsdb service' do
is_expected.to contain_service('ovsdb-server').with(
:ensure => true,
:enable => true,
:name => platform_params[:ovsdb_service_name],
:hasstatus => platform_params[:ovsdb_hasstatus],
:status => platform_params[:ovsdb_status],
)
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|

Loading…
Cancel
Save