Add fossw ML2 plugin of networking-fujitsu to puppet-neutron

Introduce manifests for fossw ML2 plugin of networking-fujitsu ML2 plugin.
This manifest configures ml2_conf.ini for fossw ML2 plugin which drives
FUJITSU FOS switch.

Change-Id: I79df6b6a27d95f0c0e2c87207ab80235a4efccfc
Implements: blueprint integration-fossw-networking-fujitsu
This commit is contained in:
Koki Sanagi 2016-12-21 14:49:33 -05:00 committed by Emilien Macchi
parent a62bf731fa
commit a465eec7f0
3 changed files with 148 additions and 0 deletions

View File

@ -0,0 +1,72 @@
#
# Configure the Fujitsu neutron ML2 plugin for FOS
#
# === Parameters
#
# [*fossw_ips*]
# (required) The List of IP address of all fos switches.
# Example: 192.168.0.1,192.168.0.2
#
# NOTE: The following parameters will be shared by all fos switches.
# [*username*]
# (optional) The username of the fos switches.
# Example: username
#
# [*password*]
# (optional) The password of the fos switches.
# Example: password
#
# [*port*]
# (optional) The port number used for SSH connection.
# Example: 22
# Defaults to 22
#
# [*timeout*]
# (optional) The timeout os SSH connection.
# Example: 30
# Defaults to 30
#
# [*udp_dest_port*]
# (optional) The port number of VXLAN UDP destination on the fos switches.
# All VXLANs on the switches use this UDP port as the UDP destination port in
# the UDP header when encapsulating.
# Example: 4789
# Defaults to 4789
#
# [*ovsdb_vlanid_range_min*]
# (optional) The minimum VLAN ID in the range that is used for binding VNI and
# physical port. The range of 78 VLAN IDs (starts from this value) will be
# reserved. Default is 2 (VLAN ID from 2 to 79 will be reserved).
# NOTE: DO NOT include these VLAN IDs into "network_vlan_ranges" in ml2_conf.ini.
# Example: 2
# Defaults to 2
#
# [*ovsdb_port*]
# (optional) The port number which OVSDB server on the fos switches listen.
# Example: 6640
# Defaults to 6640
class neutron::plugins::ml2::fujitsu::fossw (
$fossw_ips,
$username,
$password,
$port = 22,
$timeout = 30,
$udp_dest_port = 4789,
$ovsdb_vlanid_range_min = 2,
$ovsdb_port = 6640,
)
{
require ::neutron::plugins::ml2
neutron_plugin_ml2 {
'fujitsu_fossw/fossw_ips' : value => join(any2array($fossw_ips), ',');
'fujitsu_fossw/username' : value => $username;
'fujitsu_fossw/password' : value => $password;
'fujitsu_fossw/port' : value => $port;
'fujitsu_fossw/timeout' : value => $timeout;
'fujitsu_fossw/udp_dest_port' : value => $udp_dest_port;
'fujitsu_fossw/ovsdb_vlanid_range_min' : value => $ovsdb_vlanid_range_min;
'fujitsu_fossw/ovsdb_port' : value => $ovsdb_port;
}
}

View File

@ -0,0 +1,3 @@
---
features:
- Add the ability to configure fujitsu_fossw neutron ML2 plugin.

View File

@ -0,0 +1,73 @@
#
# Unit tests for neutron::plugins::ml2::fujitsu::fossw class
#
require 'spec_helper'
describe 'neutron::plugins::ml2::fujitsu::fossw' do
let :pre_condition do
"class { '::neutron::keystone::authtoken':
password => 'passw0rd',
}
class { 'neutron::server': }
class { 'neutron':
rabbit_password => 'passw0rd',
core_plugin => 'neutron.plugins.ml2.plugin.Ml2Plugin' }"
end
let :default_params do
{
:fossw_ips => '192.168.0.1,192.168.0.2',
:username => 'admin',
:password => 'admin',
:port => 22,
:timeout => 30,
:udp_dest_port => 4789,
:ovsdb_vlanid_range_min => 2,
:ovsdb_port => 6640,
}
end
let :params do
{}
end
let :test_facts do
{ :operatingsystem => 'default',
:operatingsystemrelease => 'default',
:concat_basedir => '/',
}
end
shared_examples_for 'neutron fujitsu ml2 fossw plugin' do
before do
params.merge!(default_params)
end
it do
is_expected.to contain_neutron_plugin_ml2('fujitsu_fossw/fossw_ips').with_value(params[:fossw_ips])
is_expected.to contain_neutron_plugin_ml2('fujitsu_fossw/username').with_value(params[:username])
is_expected.to contain_neutron_plugin_ml2('fujitsu_fossw/password').with_value(params[:password])
is_expected.to contain_neutron_plugin_ml2('fujitsu_fossw/port').with_value(params[:port])
is_expected.to contain_neutron_plugin_ml2('fujitsu_fossw/timeout').with_value(params[:timeout])
is_expected.to contain_neutron_plugin_ml2('fujitsu_fossw/udp_dest_port').with_value(params[:udp_dest_port])
is_expected.to contain_neutron_plugin_ml2('fujitsu_fossw/ovsdb_vlanid_range_min').with_value(params[:ovsdb_vlanid_range_min])
is_expected.to contain_neutron_plugin_ml2('fujitsu_fossw/ovsdb_port').with_value(params[:ovsdb_port])
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_configures 'neutron fujitsu ml2 fossw plugin'
end
end
end