Use common defined resource type to manage ssl options

Change-Id: I58d1b8bcc824dfc18e4c65165219dad84177bf88
This commit is contained in:
Takashi Kajinami 2024-10-07 10:11:30 +09:00
parent 8744e3daa2
commit 4f6ebbd091
2 changed files with 11 additions and 15 deletions

View File

@ -221,17 +221,13 @@ running as a standalone service, or httpd for being run by a httpd server")
# SSL Options
if $use_ssl {
cinder_config {
'ssl/cert_file' : value => $cert_file;
'ssl/key_file' : value => $key_file;
'ssl/ca_file' : value => $ca_file;
oslo::service::ssl { 'cinder_config':
cert_file => $cert_file,
key_file => $key_file,
ca_file => $ca_file
}
} else {
cinder_config {
'ssl/cert_file' : value => $facts['os_service_default'];
'ssl/key_file' : value => $facts['os_service_default'];
'ssl/ca_file' : value => $facts['os_service_default'];
}
oslo::service::ssl { 'cinder_config': }
}
if (!is_service_default($ratelimits)) {

View File

@ -38,9 +38,7 @@ describe 'cinder::api' do
:enable_proxy_headers_parsing => '<SERVICE DEFAULT>',
:max_request_body_size => '<SERVICE DEFAULT>',
)
is_expected.to contain_cinder_config('ssl/ca_file').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('ssl/cert_file').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('ssl/key_file').with_value('<SERVICE DEFAULT>')
is_expected.to contain_oslo__service__ssl('cinder_config')
end
end
@ -202,9 +200,11 @@ describe 'cinder::api' do
})
end
it { is_expected.to contain_cinder_config('ssl/ca_file').with_value('/path/to/ca') }
it { is_expected.to contain_cinder_config('ssl/cert_file').with_value('/path/to/cert') }
it { is_expected.to contain_cinder_config('ssl/key_file').with_value('/path/to/key') }
it { is_expected.to contain_oslo__service__ssl('cinder_config').with(
:ca_file => '/path/to/ca',
:cert_file => '/path/to/cert',
:key_file => '/path/to/key'
)}
end
context 'with SSL socket options set wrongly configured' do