network: New params: tunnel_id_ranges & vni_ranges

Fixes bug#731

Change-Id: I4e518662026ad19fc0bb2f5cb218132f80596a0d
This commit is contained in:
François Charlier 2014-11-27 18:35:11 +01:00
parent 556b1ab4cf
commit 5cccc2495b
2 changed files with 40 additions and 2 deletions

View File

@ -131,6 +131,16 @@
# (required) N1KV VSM (Virtual Supervisor Module) password.
# Defaults to secrete
#
# [*tunnel_id_ranges*]
# (optional) GRE tunnel id ranges. used by he ml2 plugin
# List of colon-separated id ranges
# Defaults to ['1:10000']
#
# [*vni_ranges*]
# (optional) VxLan Network ID range. used by the ml2 plugin
# List of colon-separated id ranges
# Defautls to ['1:10000']
#
class cloud::network::controller(
$neutron_db_host = '127.0.0.1',
$neutron_db_user = 'neutron',
@ -159,6 +169,9 @@ class cloud::network::controller(
$n1kv_vsm_ip = '127.0.0.1',
$n1kv_vsm_password = 'secrete',
$ks_keystone_admin_port = 35357,
# only needed by ml2 plugin
$tunnel_id_ranges = ['1:10000'],
$vni_ranges = ['1:10000'],
) {
include 'cloud::network'
@ -184,9 +197,10 @@ class cloud::network::controller(
type_drivers => $type_drivers,
tenant_network_types => $tenant_network_types,
network_vlan_ranges => $provider_vlan_ranges,
tunnel_id_ranges => ['1:10000'],
tunnel_id_ranges => $tunnel_id_ranges,
vni_ranges => $vni_ranges,
flat_networks => $flat_networks,
mechanism_drivers => ['linuxbridge','openvswitch','l2population'],
mechanism_drivers => ['linuxbridge', 'openvswitch','l2population'],
enable_security_group => true
}
}

View File

@ -75,6 +75,7 @@ describe 'cloud::network::controller' do
:tenant_network_types => ['gre'],
:mechanism_drivers => ['linuxbridge','openvswitch','l2population'],
:tunnel_id_ranges => ['1:10000'],
:vni_ranges => ['1:10000'],
:network_vlan_ranges => ['physnet1:1000:2999'],
:flat_networks => ['public'],
:enable_security_group => true
@ -148,6 +149,29 @@ describe 'cloud::network::controller' do
end
end
context 'with custom ml2 parameters' do
before :each do
params.merge!(
:tenant_network_types => ['vxlan'],
:type_drivers => ['gre', 'vlan', 'flat', 'vxlan'],
:tunnel_id_ranges => ['100:300'],
:vni_ranges => ['42:51','53:69'],
)
end
it 'contains correct parameters' do
is_expected.to contain_class('neutron::plugins::ml2').with(
:type_drivers => ['gre', 'vlan', 'flat', 'vxlan'],
:tenant_network_types => ['vxlan'],
:mechanism_drivers => ['linuxbridge', 'openvswitch','l2population'],
:tunnel_id_ranges => ['100:300'],
:vni_ranges => ['42:51','53:69'],
:network_vlan_ranges => ['physnet1:1000:2999'],
:flat_networks => ['public'],
:enable_security_group => true
)
end
end
end
context 'on Debian platforms' do