From 80cf1085e208f3412b2a50f473b6583523692255 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Thu, 31 Mar 2016 16:07:23 -0400 Subject: [PATCH] api: move SSL parameters under [ssl] section Move SSL parameters under [ssl] section, like it should be done when using Oslo Service. Change-Id: I5ae991970f949dd9cfe2948b829ba5bb9834423c --- manifests/api.pp | 12 ++++++------ spec/classes/trove_api_spec.rb | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/manifests/api.pp b/manifests/api.pp index 5216b5db..31c4749c 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -283,29 +283,29 @@ class trove::api( # SSL Options if $cert_file { trove_config { - 'DEFAULT/cert_file' : value => $cert_file; + 'ssl/cert_file' : value => $cert_file; } } else { trove_config { - 'DEFAULT/cert_file': ensure => absent; + 'ssl/cert_file': ensure => absent; } } if $key_file { trove_config { - 'DEFAULT/key_file' : value => $key_file; + 'ssl/key_file' : value => $key_file; } } else { trove_config { - 'DEFAULT/key_file': ensure => absent; + 'ssl/key_file': ensure => absent; } } if $ca_file { trove_config { - 'DEFAULT/ca_file' : value => $ca_file; + 'ssl/ca_file' : value => $ca_file; } } else { trove_config { - 'DEFAULT/ca_file': ensure => absent; + 'ssl/ca_file': ensure => absent; } } diff --git a/spec/classes/trove_api_spec.rb b/spec/classes/trove_api_spec.rb index 685dd1c0..6a57cdd4 100644 --- a/spec/classes/trove_api_spec.rb +++ b/spec/classes/trove_api_spec.rb @@ -91,6 +91,9 @@ describe 'trove::api' do is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(false) is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('') is_expected.to contain_trove_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(false) + is_expected.to contain_trove_config('ssl/cert_file').with_ensure('absent') + is_expected.to contain_trove_config('ssl/key_file').with_ensure('absent') + is_expected.to contain_trove_config('ssl/ca_file').with_ensure('absent') end context 'with deprecated parameters' do @@ -114,6 +117,22 @@ describe 'trove::api' do end end + context 'with SSL enabled on API' do + before :each do + params.merge!( + :cert_file => 'cert', + :key_file => 'key', + :ca_file => 'ca', + ) + end + + it 'contains ssl parameters' do + is_expected.to contain_trove_config('ssl/cert_file').with_value('cert') + is_expected.to contain_trove_config('ssl/key_file').with_value('key') + is_expected.to contain_trove_config('ssl/ca_file').with_value('ca') + end + end + context 'with overridden rate limit parameters' do before :each do params.merge!(