Remove unused enable_tunneling in openvswitch_agent.ini

As described in https://bugs.launchpad.net/neutron/+bug/1531890, the ovs
agent does not use the 'agent_tunneling' setting in openvswitch_agent.ini,
instead it uses 'tunnel_types'.  This fix removes it from being set in
the .ini file and also sets local_ip, tunnel_bridge, etc. based on the
'tunnel_types' hieradata parameter.  The hieradata 'enable_tunneling'
is being removed in https://review.openstack.org/#/c/335235/.

Partial-Bug: 1532830

Change-Id: I73630653330c67444827f32740c44e9d25b5db31
This commit is contained in:
Bob Fournier 2016-07-14 19:20:01 -04:00 committed by Emilien Macchi
parent d591774c54
commit 6556a9baae
5 changed files with 38 additions and 30 deletions

View File

@ -33,7 +33,7 @@ class { '::neutron::agents::metering': }
# Agent
class { '::neutron::agents::ml2::ovs':
local_ip => '192.168.1.1',
enable_tunneling => true,
tunnel_types => ['vxlan']
}
# ml2 plugin with vxlan as ml2 driver and ovs as mechanism driver
@ -59,5 +59,5 @@ class { '::neutron':
# Agent
class { '::neutron::agents::ml2::ovs':
local_ip => '192.168.1.11',
enable_tunneling => true,
tunnel_types => ['vxlan']
}

View File

@ -46,14 +46,10 @@
# (optional) Integration bridge in OVS
# Defaults to 'br-int'
#
# [*enable_tunneling*]
# (optional) Enable or not tunneling
# Defaults to false
#
# [*tunnel_types*]
# (optional) List of types of tunnels to use when utilizing tunnels,
# either 'gre' or 'vxlan'.
# Defaults to false
# Defaults to empty list
#
# [*local_ip*]
# (optional) Local IP address of GRE tunnel endpoints.
@ -141,6 +137,10 @@
# (optional) Enable or not ARP Spoofing Protection
# Defaults to $::os_service_default
#
# [*enable_tunneling*]
# (optional) Enable or not tunneling
# Defaults to false
#
class neutron::agents::ml2::ovs (
$package_ensure = 'present',
$enabled = true,
@ -149,7 +149,6 @@ class neutron::agents::ml2::ovs (
$bridge_uplinks = [],
$bridge_mappings = [],
$integration_bridge = 'br-int',
$enable_tunneling = false,
$tunnel_types = [],
$local_ip = false,
$tunnel_bridge = 'br-tun',
@ -169,6 +168,7 @@ class neutron::agents::ml2::ovs (
$purge_config = false,
# DEPRECATED PARAMETERS
$prevent_arp_spoofing = $::os_service_default,
$enable_tunneling = false,
) {
include ::neutron::deps
@ -177,11 +177,22 @@ class neutron::agents::ml2::ovs (
require ::vswitch::ovs
}
if $enable_tunneling and ! $local_ip {
if $enable_tunneling {
warning('The enable_tunneling parameter is deprecated. Please set tunnel_types with the desired type to enable tunneling.')
}
validate_array($tunnel_types)
if $enable_tunneling or (size($tunnel_types) > 0) {
$enable_tunneling_real = true
} else {
$enable_tunneling_real = false
}
if $enable_tunneling_real and ! $local_ip {
fail('Local ip for ovs agent must be set when tunneling is enabled')
}
if ($enable_tunneling) and (!is_service_default($enable_distributed_routing)) and (!is_service_default($l2_population)) {
if ($enable_tunneling_real) and (!is_service_default($enable_distributed_routing)) and (!is_service_default($l2_population)) {
if $enable_distributed_routing and ! $l2_population {
fail('L2 population must be enabled when DVR and tunneling are enabled')
}
@ -248,20 +259,15 @@ class neutron::agents::ml2::ovs (
neutron_agent_ovs { 'securitygroup/firewall_driver': ensure => absent }
}
if $enable_tunneling {
if $enable_tunneling_real {
neutron_agent_ovs {
'ovs/enable_tunneling': value => true;
'ovs/tunnel_bridge': value => $tunnel_bridge;
'ovs/local_ip': value => $local_ip;
'ovs/int_peer_patch_port': value => $int_peer_patch_port;
'ovs/tun_peer_patch_port': value => $tun_peer_patch_port;
}
if size($tunnel_types) > 0 {
neutron_agent_ovs {
'agent/tunnel_types': value => join($tunnel_types, ',');
}
}
if 'vxlan' in $tunnel_types {
validate_vxlan_udp_port($vxlan_udp_port)
neutron_agent_ovs {
@ -270,7 +276,6 @@ class neutron::agents::ml2::ovs (
}
} else {
neutron_agent_ovs {
'ovs/enable_tunneling': value => false;
'ovs/tunnel_bridge': ensure => absent;
'ovs/local_ip': ensure => absent;
'ovs/int_peer_patch_port': ensure => absent;

View File

@ -0,0 +1,7 @@
---
deprecations:
- The option enable_tunneling has been deprecated as it is no longer used.
In order to enable tunneling, tunnel_types should be set to
the desired type.
If tunnel_types is not set, tunneling will be disabled.

View File

@ -71,7 +71,6 @@ describe 'basic neutron' do
}
class { '::neutron::agents::metering': debug => true }
class { '::neutron::agents::ml2::ovs':
enable_tunneling => true,
local_ip => '127.0.0.1',
tunnel_types => ['vxlan'],
}

View File

@ -12,8 +12,8 @@ describe 'neutron::agents::ml2::ovs' do
:bridge_uplinks => [],
:bridge_mappings => [],
:integration_bridge => 'br-int',
:enable_tunneling => false,
:local_ip => false,
:tunnel_types => [],
:tunnel_bridge => 'br-tun',
:drop_flows_on_start => false,
:firewall_driver => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver',
@ -58,7 +58,6 @@ describe 'neutron::agents::ml2::ovs' do
is_expected.to contain_neutron_agent_ovs('ovs/integration_bridge').with_value(p[:integration_bridge])
is_expected.to contain_neutron_agent_ovs('securitygroup/firewall_driver').\
with_value(p[:firewall_driver])
is_expected.to contain_neutron_agent_ovs('ovs/enable_tunneling').with_value(false)
is_expected.to contain_neutron_agent_ovs('ovs/tunnel_bridge').with_ensure('absent')
is_expected.to contain_neutron_agent_ovs('ovs/local_ip').with_ensure('absent')
is_expected.to contain_neutron_agent_ovs('ovs/int_peer_patch_port').with_ensure('absent')
@ -209,17 +208,16 @@ describe 'neutron::agents::ml2::ovs' do
context 'when enabling tunneling' do
context 'without local ip address' do
before :each do
params.merge!(:enable_tunneling => true)
params.merge!(:tunnel_types => ['vxlan'])
end
it_raises 'a Puppet::Error', /Local ip for ovs agent must be set when tunneling is enabled/
end
context 'with default params' do
before :each do
params.merge!(:enable_tunneling => true, :local_ip => '127.0.0.1' )
params.merge!(:tunnel_types => ['vxlan'], :local_ip => '127.0.0.1' )
end
it 'should configure ovs for tunneling' do
is_expected.to contain_neutron_agent_ovs('ovs/enable_tunneling').with_value(true)
is_expected.to contain_neutron_agent_ovs('ovs/tunnel_bridge').with_value(default_params[:tunnel_bridge])
is_expected.to contain_neutron_agent_ovs('ovs/local_ip').with_value('127.0.0.1')
is_expected.to contain_neutron_agent_ovs('ovs/int_peer_patch_port').with_value('<SERVICE DEFAULT>')
@ -229,8 +227,7 @@ describe 'neutron::agents::ml2::ovs' do
context 'with vxlan tunneling' do
before :each do
params.merge!(:enable_tunneling => true,
:local_ip => '127.0.0.1',
params.merge!(:local_ip => '127.0.0.1',
:tunnel_types => ['vxlan'],
:vxlan_udp_port => '4789')
end
@ -245,7 +242,7 @@ describe 'neutron::agents::ml2::ovs' do
before :each do
params.merge!(:enable_distributed_routing => true,
:l2_population => false,
:enable_tunneling => true,
:tunnel_types => ['vxlan'],
:local_ip => '127.0.0.1' )
end
@ -256,7 +253,7 @@ describe 'neutron::agents::ml2::ovs' do
before :each do
params.merge!(:enable_distributed_routing => true,
:l2_population => false,
:enable_tunneling => false )
:tunnel_types => [] )
end
it 'should enable DVR without L2 population' do