Merge "Add support for [certificates] storage_path option"

This commit is contained in:
Zuul 2024-05-07 19:19:36 +00:00 committed by Gerrit Code Review
commit 0aa188ebed
3 changed files with 52 additions and 4 deletions

View File

@ -5,17 +5,23 @@
# === Parameters:
#
# [*cert_manager_type*]
# (optional) Certificate Manager plugin. Defaults to barbican. (string value)
# Defaults to 'barbican'
# (optional) Certificate Manager plugin.
# Defaults to $facts['os_service_default']
#
# [*storage_path*]
# (optional) Absolute path of the certificate storage directory.
# Defaults to $facts['os_service_default']
#
class magnum::certificates (
$cert_manager_type = $facts['os_service_default'],
$storage_path = $facts['os_service_default'],
) {
include magnum::deps
magnum_config { 'certificates/cert_manager_type':
value => $cert_manager_type;
magnum_config {
'certificates/cert_manager_type': value => $cert_manager_type;
'certificates/storage_path': value => $storage_path;
}
}

View File

@ -0,0 +1,4 @@
---
features:
- |
The new ``magnum::certificates::storage_path`` parameter has been added.

View File

@ -0,0 +1,38 @@
require 'spec_helper'
describe 'magnum::certificates' do
shared_examples 'magnum::certificates' do
it 'contains default values' do
is_expected.to contain_magnum_config('certificates/cert_manager_type').with_value('<SERVICE DEFAULT>')
is_expected.to contain_magnum_config('certificates/storage_path').with_value('<SERVICE DEFAULT>')
end
context 'configure certificates with parameters' do
let :params do
{
:cert_manager_type => 'barbican',
:storage_path => '/var/lib/magnum/certificates/',
}
end
it 'contains overridden values' do
is_expected.to contain_magnum_config('certificates/cert_manager_type').with_value('barbican')
is_expected.to contain_magnum_config('certificates/storage_path').with_value('/var/lib/magnum/certificates/')
end
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge(OSDefaults.get_facts({}))
end
it_behaves_like 'magnum::certificates'
end
end
end