Add configuration for lbaas certificates

Added configuration for lbaas certificates configuration. The options
to configure the certificate managgement type and the storage path
for the lbaas certificates has been added in this change.

Change-Id: Ifa5604f6bd8c8110722450460f887a1982e6c03d
This commit is contained in:
Matthew J. Black 2016-09-01 16:17:43 -04:00
parent 272d74d306
commit 258f7f2529
3 changed files with 51 additions and 0 deletions

View File

@ -29,6 +29,21 @@
# (optional) Whether to install the lbaas driver package
# Defaults to 'present'
#
# [*cert_manager_type*]
# (optional) Certificate manager type to use for lbaas.
# Defaults to $::os_service_default
# Example: barbican
#
# [*cert_storage_path*]
# (optional) The location to store certificates locally.
# Defaults to $::os_service_default
# Example: /var/lib/neutron-lbaas/certificates/
#
# [*barbican_auth*]
# (optional) Name of the barbican authentication method to use.
# Defaults to $::os_service_default
# Example: barbican_acl_auth
#
# === Deprecated Parameters
#
# [*service_providers*]
@ -46,6 +61,9 @@
# Defaults to false
#
class neutron::services::lbaas (
$cert_manager_type = $::os_service_default,
$cert_storage_path = $::os_service_default,
$barbican_auth = $::os_service_default,
$ensure_lbaas_driver_package = 'present',
$service_providers = $::os_service_default,
# DEPRECATED
@ -61,6 +79,13 @@ class neutron::services::lbaas (
tag => ['openstack', 'neutron-package']
})
}
neutron_config {
'certificates/cert_manager_type': value => $cert_manager_type;
'certificates/storage_path': value => $cert_storage_path;
'certificates/barbican_auth': value => $barbican_auth;
}
if !is_service_default($service_providers) {
warning('service_providers in neutron::services::lbaas is deprecated in newton release, please use service provider in neutron::server class')
}

View File

@ -0,0 +1,3 @@
---
features:
- Add certificates configuration options for lbaas service.

View File

@ -36,6 +36,29 @@ describe 'neutron::services::lbaas' do
it 'should contain python-neutron-lbaas package' do
is_expected.to contain_package('python-neutron-lbaas').with({ :ensure => 'present' })
end
it 'should set certificates options with service defaults' do
is_expected.to contain_neutron_config('certificates/cert_manager_type').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('certificates/storage_path').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('certificates/barbican_auth').with_value('<SERVICE DEFAULT>')
end
end
context 'with certificate manager options' do
before :each do
params.merge!(
{ :cert_manager_type => 'barbican',
:cert_storage_path => '/var/lib/neutron-lbaas/certificates/',
:barbican_auth => 'barbican_acl_auth'
}
)
it 'should configure certificates section' do
is_expected.to contain_neutron_config('certificates/cert_manager_type').with_value('barbican')
is_expected.to contain_neutron_config('certificates/storage_path').with_value('/var/lib/neutron-lbaas/certificates/')
is_expected.to contain_neutron_config('certificates/barbican_auth').with_value('barbican_acl_auth')
end
end
end
context 'with multiple service providers' do