Skip to content

Commit

Permalink
Include external network bridge for vpn agent
Browse files Browse the repository at this point in the history
fix to make external network bridge configurable
in the vpn_agent.ini config file. Defaults to
nil.

Change-Id: Iddb6ff6296b8f2d42d97fdcb36a9819a4a995034
  • Loading branch information
Pradeep Kilambi committed Apr 7, 2014
1 parent 60a4298 commit 3356503
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
14 changes: 14 additions & 0 deletions manifests/agents/vpnaas.pp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
# [*interface_driver*]
# (optional) Defaults to 'neutron.agent.linux.interface.OVSInterfaceDriver'.
#
# [*external_network_bridge]
# (optional) Defaults to undef
#
# [*ipsec_status_check_interval*]
# (optional) Status check interval. Defaults to '60'.
#
Expand All @@ -46,6 +49,7 @@
$manage_service = true,
$vpn_device_driver = 'neutron.services.vpn.device_drivers.ipsec.OpenSwanDriver',
$interface_driver = 'neutron.agent.linux.interface.OVSInterfaceDriver',
$external_network_bridge = undef,
$ipsec_status_check_interval = '60'
) {

Expand Down Expand Up @@ -76,6 +80,16 @@
'DEFAULT/interface_driver': value => $interface_driver;
}

if ($external_network_bridge) {
neutron_vpnaas_agent_config {
'DEFAULT/external_network_bridge': value => $external_network_bridge;
}
} else {
neutron_vpnaas_agent_config {
'DEFAULT/external_network_bridge': ensure => absent;
}
}

if $::neutron::params::vpnaas_agent_package {
Package['neutron'] -> Package['neutron-vpnaas-agent']
Package['neutron-vpnaas-agent'] -> Neutron_vpnaas_agent_config<||>
Expand Down
13 changes: 13 additions & 0 deletions spec/classes/neutron_agents_vpnaas_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@
should contain_neutron_vpnaas_agent_config('vpnagent/vpn_device_driver').with_value(p[:vpn_device_driver]);
should contain_neutron_vpnaas_agent_config('ipsec/ipsec_status_check_interval').with_value(p[:ipsec_status_check_interval]);
should contain_neutron_vpnaas_agent_config('DEFAULT/interface_driver').with_value(p[:interface_driver]);
should contain_neutron_vpnaas_agent_config('DEFAULT/external_network_bridge').with_ensure('absent');
end

context 'with external_network_bridge as br-ex' do
before do
params.merge!(
:external_network_bridge => 'br-ex'
)
end

it 'configures vpnaas_agent.ini' do
should contain_neutron_vpnaas_agent_config('DEFAULT/external_network_bridge').with_value(p[:external_network_bridge]);
end
end

it 'installs neutron vpnaas agent package' do
Expand Down

0 comments on commit 3356503

Please sign in to comment.