Enable Key Manager service (Barbican) parameter

Allow to use Barbican in Cinder with keymgr/api_class parameter.

Change-Id: I355b1afa47d33d493ea0d951675983841a8299b4
This commit is contained in:
Emilien Macchi 2016-07-08 16:20:25 -04:00
parent c99098602a
commit a6478835b2
3 changed files with 22 additions and 0 deletions

View File

@ -29,6 +29,11 @@
# for example "-c3" for idle only priority.
# Defaults to $::os_service_default.
#
# [*keymgr_api_class*]
# (optional) Key Manager service.
# Example of valid value: cinder.keymgr.barbican.BarbicanKeyManager
# Defaults to $::os_service_default
#
class cinder::volume (
$package_ensure = 'present',
$enabled = true,
@ -36,6 +41,7 @@ class cinder::volume (
$volume_clear = $::os_service_default,
$volume_clear_size = $::os_service_default,
$volume_clear_ionice = $::os_service_default,
$keymgr_api_class = $::os_service_default,
) {
include ::cinder::params
@ -78,5 +84,6 @@ class cinder::volume (
'DEFAULT/volume_clear': value => $volume_clear;
'DEFAULT/volume_clear_size': value => $volume_clear_size;
'DEFAULT/volume_clear_ionice': value => $volume_clear_ionice;
'keymgr/api_class': value => $keymgr_api_class;
}
}

View File

@ -0,0 +1,3 @@
---
features:
- Allow to configure Key Manager api class parameter to communicate with Barbican.

View File

@ -18,6 +18,7 @@ describe 'cinder::volume' do
it { is_expected.to contain_cinder_config('DEFAULT/volume_clear').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_cinder_config('DEFAULT/volume_clear_size').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_cinder_config('DEFAULT/volume_clear_ionice').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_cinder_config('keymgr/api_class').with_value('<SERVICE DEFAULT>') }
describe 'with manage_service false' do
let :params do
@ -42,4 +43,15 @@ describe 'cinder::volume' do
is_expected.to contain_cinder_config('DEFAULT/volume_clear_ionice').with_value('-c3')
end
end
describe 'with barbican parameters' do
let :params do
{
'keymgr_api_class' => 'cinder.keymgr.barbican.BarbicanKeyManager',
}
end
it 'should set keymgr parameters' do
is_expected.to contain_cinder_config('keymgr/api_class').with_value('cinder.keymgr.barbican.BarbicanKeyManager')
end
end
end