Support NeutronNetworkPlugin options
Change-Id: I39f3758379a724b07a11e827be3af520ef2cd3f2
This commit is contained in:
parent
0433ff3886
commit
d7ecfc750f
33
manifests/network/neutron_network.pp
Normal file
33
manifests/network/neutron_network.pp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# == define: manila::network::neutron_network
|
||||||
|
#
|
||||||
|
# Setup and configure the Neutron network plugin
|
||||||
|
#
|
||||||
|
# === Parameters
|
||||||
|
#
|
||||||
|
# [*neutron_physical_net_name*]
|
||||||
|
# (required) The name of the physical network to determine which net segment
|
||||||
|
# is used.
|
||||||
|
#
|
||||||
|
# [*network_plugin_ipv4_enabled*]
|
||||||
|
# (optional) Whether to support Ipv4 network resource.
|
||||||
|
# Defaults to $facts['os_service_default'].
|
||||||
|
#
|
||||||
|
# [*network_plugin_ipv6_enabled*]
|
||||||
|
# (optional) whether to support IPv6 network resource.
|
||||||
|
# Defaults to $facts['os_service_default'].
|
||||||
|
#
|
||||||
|
define manila::network::neutron_network (
|
||||||
|
$neutron_physical_net_name,
|
||||||
|
$network_plugin_ipv4_enabled = $facts['os_service_default'],
|
||||||
|
$network_plugin_ipv6_enabled = $facts['os_service_default'],
|
||||||
|
) {
|
||||||
|
|
||||||
|
$neutron_single_plugin_name = 'manila.network.neutron.neutron_network_plugin.NeutronNetworkPlugin'
|
||||||
|
|
||||||
|
manila_config {
|
||||||
|
"${name}/network_api_class": value => $neutron_single_plugin_name;
|
||||||
|
"${name}/neutron_physical_net_name": value => $neutron_physical_net_name;
|
||||||
|
"${name}/network_plugin_ipv4_enabled": value => $network_plugin_ipv4_enabled;
|
||||||
|
"${name}/network_plugin_ipv6_enabled": value => $network_plugin_ipv6_enabled;
|
||||||
|
}
|
||||||
|
}
|
@ -5,23 +5,21 @@
|
|||||||
# === Parameters
|
# === Parameters
|
||||||
#
|
#
|
||||||
# [*neutron_net_id*]
|
# [*neutron_net_id*]
|
||||||
# (required) Default Neutron network that will be used for share server
|
# (required) Default Neutron network that will be used for share server
|
||||||
# creation. This opt is used only with
|
# creation.
|
||||||
# class 'NeutronSingleNetworkPlugin'.
|
|
||||||
#
|
#
|
||||||
# [*neutron_subnet_id*]
|
# [*neutron_subnet_id*]
|
||||||
# (required) Default Neutron subnet that will be used for share server
|
# (required) Default Neutron subnet that will be used for share server
|
||||||
# creation. Should be assigned to network defined in opt
|
# creation. Should be assigned to network defined in opt
|
||||||
# 'neutron_net_id'. This opt is used only with
|
# 'neutron_net_id'.
|
||||||
# class 'NeutronSingleNetworkPlugin'.
|
|
||||||
#
|
#
|
||||||
# [*network_plugin_ipv4_enabled*]
|
# [*network_plugin_ipv4_enabled*]
|
||||||
# (optional) Whether to support Ipv4 network resource.
|
# (optional) Whether to support Ipv4 network resource.
|
||||||
# Defaults to $facts['os_service_default'].
|
# Defaults to $facts['os_service_default'].
|
||||||
#
|
#
|
||||||
# [*network_plugin_ipv6_enabled*]
|
# [*network_plugin_ipv6_enabled*]
|
||||||
# (optional) whether to support IPv6 network resource.
|
# (optional) whether to support IPv6 network resource.
|
||||||
# Defaults to $facts['os_service_default'].
|
# Defaults to $facts['os_service_default'].
|
||||||
#
|
#
|
||||||
define manila::network::neutron_single_network (
|
define manila::network::neutron_single_network (
|
||||||
$neutron_net_id,
|
$neutron_net_id,
|
||||||
|
5
releasenotes/notes/neutron-network-d3ebedd26c3877a4.yaml
Normal file
5
releasenotes/notes/neutron-network-d3ebedd26c3877a4.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The new ``manila::network::neutron_network`` defined resource type has been
|
||||||
|
added. It supports managing the options of neutron network plugin.
|
61
spec/defines/manila_network_neutron_network_spec.rb
Normal file
61
spec/defines/manila_network_neutron_network_spec.rb
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe 'manila::network::neutron_network' do
|
||||||
|
let(:title) do
|
||||||
|
'neutronnet'
|
||||||
|
end
|
||||||
|
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:neutron_physical_net_name => 'br-ex',
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
shared_examples 'manila::network::neutron_network' do
|
||||||
|
context 'with required parameters' do
|
||||||
|
it 'configures neutron single network plugin' do
|
||||||
|
is_expected.to contain_manila_config("neutronnet/network_api_class").with_value(
|
||||||
|
'manila.network.neutron.neutron_network_plugin.NeutronNetworkPlugin')
|
||||||
|
|
||||||
|
is_expected.to contain_manila_config('neutronnet/neutron_physical_net_name')\
|
||||||
|
.with_value('br-ex')
|
||||||
|
is_expected.to contain_manila_config('neutronnet/network_plugin_ipv4_enabled')\
|
||||||
|
.with_value('<SERVICE DEFAULT>')
|
||||||
|
is_expected.to contain_manila_config('neutronnet/network_plugin_ipv6_enabled')\
|
||||||
|
.with_value('<SERVICE DEFAULT>')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with custom parameters' do
|
||||||
|
before do
|
||||||
|
params.merge!({
|
||||||
|
:network_plugin_ipv4_enabled => true,
|
||||||
|
:network_plugin_ipv6_enabled => false,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
it 'configures neutron single network plugin' do
|
||||||
|
is_expected.to contain_manila_config("neutronnet/network_api_class").with_value(
|
||||||
|
'manila.network.neutron.neutron_network_plugin.NeutronNetworkPlugin')
|
||||||
|
|
||||||
|
is_expected.to contain_manila_config('neutronnet/neutron_physical_net_name')\
|
||||||
|
.with_value('br-ex')
|
||||||
|
is_expected.to contain_manila_config('neutronnet/network_plugin_ipv4_enabled')\
|
||||||
|
.with_value(true)
|
||||||
|
is_expected.to contain_manila_config('neutronnet/network_plugin_ipv6_enabled')\
|
||||||
|
.with_value(false)
|
||||||
|
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 'manila::network::neutron_network'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -1,7 +1,9 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'manila::network::neutron_single_network' do
|
describe 'manila::network::neutron_single_network' do
|
||||||
let("title") {'neutronsingle'}
|
let(:title) do
|
||||||
|
'neutronsingle'
|
||||||
|
end
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user