ssl: Reject if only one of cert_file and key_file is set

Both of cert_file and key_file should be set to use SSL feature.
Change-Id: I6fa5353e3af18b97f720f6acb6eaf25a25413942
This commit is contained in:
Takashi Kajinami
2024年10月07日 10:25:35 +09:00
parent b6b0589570
commit ebdef74a82

View File

@@ -40,6 +40,10 @@ define oslo::service::ssl (
$version=$facts['os_service_default'],
){
if is_service_default($cert_file) != is_service_default($key_file) {
fail('Both of cert_file and key_file should be set or unset.')
}
$service_options={
'ssl/ca_file' => { value => $ca_file },
'ssl/cert_file'=>{ value => $cert_file },

View File

@@ -35,6 +35,30 @@ describe 'oslo::service::ssl' do
is_expected.to contain_keystone_config('ssl/version').with_value('TLSv1')
end
end
context 'with only cert_file' do
let :params do
{
:cert_file => '/path/to/cert/file',
}
end
it 'fails because of incomplete input' do
should raise_error(Puppet::Error)
end
end
context 'with only key_file' do
let :params do
{
:key_file => '/path/to/key/file',
}
end
it 'fails because of incomplete input' do
should raise_error(Puppet::Error)
end
end
end
on_supported_os({
Reference in New Issue
openstack/puppet-oslo
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.