Merge "Support the LibreSwan driver in Red Hat platforms"

This commit is contained in:
Jenkins 2016-02-08 22:54:17 +00:00 committed by Gerrit Code Review
commit 079bcc4f93
3 changed files with 42 additions and 0 deletions

View File

@ -68,6 +68,17 @@ class neutron::agents::vpnaas (
name => $::neutron::params::openswan_package, name => $::neutron::params::openswan_package,
} }
} }
/\.LibreSwan/: {
if($::osfamily != 'Redhat') {
fail("LibreSwan is not supported on osfamily ${::osfamily}")
} else {
Package['libreswan'] -> Package<| title == 'neutron-vpnaas-agent' |>
package { 'libreswan':
ensure => present,
name => $::neutron::params::libreswan_package,
}
}
}
default: { default: {
fail("Unsupported vpn_device_driver ${vpn_device_driver}") fail("Unsupported vpn_device_driver ${vpn_device_driver}")
} }

View File

@ -70,6 +70,7 @@ class neutron::params {
} else { } else {
$openswan_package = 'openswan' $openswan_package = 'openswan'
} }
$libreswan_package = 'libreswan'
$l3_agent_package = false $l3_agent_package = false
$l3_agent_service = 'neutron-l3-agent' $l3_agent_service = 'neutron-l3-agent'
@ -156,6 +157,7 @@ class neutron::params {
$vpnaas_agent_service = 'neutron-vpn-agent' $vpnaas_agent_service = 'neutron-vpn-agent'
$openswan_package = 'openswan' $openswan_package = 'openswan'
$libreswan_package = false
$metadata_agent_package = 'neutron-metadata-agent' $metadata_agent_package = 'neutron-metadata-agent'
$metadata_agent_service = 'neutron-metadata-agent' $metadata_agent_service = 'neutron-metadata-agent'

View File

@ -133,6 +133,18 @@ describe 'neutron::agents::vpnaas' do
it 'configures subscription to neutron-vpnaas-agent package' do it 'configures subscription to neutron-vpnaas-agent package' do
is_expected.to contain_service('neutron-vpnaas-service').that_subscribes_to('Package[neutron-vpnaas-agent]') is_expected.to contain_service('neutron-vpnaas-service').that_subscribes_to('Package[neutron-vpnaas-agent]')
end end
context 'when configuring the LibreSwan driver' do
before do
params.merge!(
:vpn_device_driver => 'neutron_vpnaas.services.vpn.device_drivers.libreswan_ipsec.LibreSwanDriver'
)
end
it 'fails when configuring LibreSwan on Debian' do
is_expected.to raise_error(Puppet::Error, /LibreSwan is not supported on osfamily Debian/)
end
end
end end
context 'on RedHat 6 platforms' do context 'on RedHat 6 platforms' do
@ -162,10 +174,27 @@ describe 'neutron::agents::vpnaas' do
let :platform_params do let :platform_params do
{ :openswan_package => 'libreswan', { :openswan_package => 'libreswan',
:libreswan_package => 'libreswan',
:vpnaas_agent_package => 'openstack-neutron-vpnaas', :vpnaas_agent_package => 'openstack-neutron-vpnaas',
:vpnaas_agent_service => 'neutron-vpn-agent'} :vpnaas_agent_service => 'neutron-vpn-agent'}
end end
it_configures 'neutron vpnaas agent' it_configures 'neutron vpnaas agent'
context 'when configuring the LibreSwan driver' do
before do
params.merge!(
:vpn_device_driver => 'neutron_vpnaas.services.vpn.device_drivers.libreswan_ipsec.LibreSwanDriver'
)
end
it 'configures LibreSwan' do
is_expected.to contain_neutron_vpnaas_agent_config('vpnagent/vpn_device_driver').with_value(params[:vpn_device_driver]);
is_expected.to contain_package('libreswan').with(
:ensure => 'present',
:name => platform_params[:libreswan_package]
)
end
end
end end
end end