From 62f3f263cadfd026ed5ad269958062ed43743413 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Fri, 8 May 2015 10:36:47 -0400 Subject: [PATCH] vswitch: add 2 parameters for l2_pop and tunnelling Allow to disable L2_pop and tunnelling. Change-Id: If0007ed1ee67ec6573645ea8e8af024d2f0a038a --- manifests/network/vswitch.pp | 19 ++++++++++++++++--- spec/classes/cloud_network_vswitch_spec.rb | 22 ++++++++++++++++++++++ 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/manifests/network/vswitch.pp b/manifests/network/vswitch.pp index 0a00ce6c..3c175c7d 100644 --- a/manifests/network/vswitch.pp +++ b/manifests/network/vswitch.pp @@ -133,6 +133,17 @@ # (optional) N1000 KV Domain ID (does nothing?) # Defaults to 1000 # +# [*enable_tunneling*] +# (optional) Enable or not tunneling. +# Should be disable if using VLAN but enabled if using GRE or VXLAN. +# Defailts to true +# +# [*l2_population*] +# (optional) Enable or not L2 population. +# If enabled, should be part of mechanism_drivers in cloud::network::controller. +# Should be disabled if running L3 HA with VRRP in Juno. +# Defaults to true +# # [*firewall_settings*] # (optional) Allow to add custom parameters to firewall rules # Should be an hash. @@ -148,6 +159,8 @@ class cloud::network::vswitch( # common to ml2 $tunnel_types = ['gre'], $tunnel_eth = '127.0.0.1', + $enable_tunneling = true, + $l2_population = true, # ml2_ovs $provider_bridge_mappings = ['public:br-pub'], $enable_distributed_routing = false, @@ -168,8 +181,8 @@ class cloud::network::vswitch( case $driver { 'ml2_ovs': { class { 'neutron::agents::ml2::ovs': - enable_tunneling => true, - l2_population => true, + enable_tunneling => $enable_tunneling, + l2_population => $l2_population, polling_interval => '15', tunnel_types => $tunnel_types, bridge_mappings => $provider_bridge_mappings, @@ -184,7 +197,7 @@ class cloud::network::vswitch( 'ml2_lb': { class { 'neutron::agents::ml2::linuxbridge': - l2_population => true, + l2_population => $l2_population, polling_interval => '15', tunnel_types => $tunnel_types, local_ip => $tunnel_eth diff --git a/spec/classes/cloud_network_vswitch_spec.rb b/spec/classes/cloud_network_vswitch_spec.rb index d101b76e..8d7b81bc 100644 --- a/spec/classes/cloud_network_vswitch_spec.rb +++ b/spec/classes/cloud_network_vswitch_spec.rb @@ -87,6 +87,28 @@ describe 'cloud::network::vswitch' do end end + context 'when running ML2 plugin with OVS driver and without tunelling' do + before :each do + params.merge!(:enable_tunneling => false) + end + it 'configure neutron vswitch without tunneling' do + is_expected.to contain_class('neutron::agents::ml2::ovs').with( + :enable_tunneling => false, + ) + end + end + + context 'when running ML2 plugin with OVS driver and without l2 population' do + before :each do + params.merge!(:l2_population => false) + end + it 'configure neutron vswitch without l2 population' do + is_expected.to contain_class('neutron::agents::ml2::ovs').with( + :l2_population => false, + ) + end + end + context 'when running Cisco N1KV plugin with VEM driver' do before do facts.merge!( :osfamily => 'RedHat' )