Add allow_tls_terminated_listeners config option

Adds the allow_tls_terminated_listeners config option to
the octavia::api class, this sets the
[api_settings]/allow_tls_terminated_listeners option in
the octavia.conf file.

Change-Id: I9da0f52addaab9c484ce5d5cfa9b233439a873e6
This commit is contained in:
Tobias Urdin
2018-08-29 11:36:44 +02:00
parent 54c9e53a27
commit 14c52579f1
3 changed files with 32 additions and 18 deletions

View File

@@ -30,6 +30,10 @@
# (optional) The handler that the API communicates with # (optional) The handler that the API communicates with
# Defaults to $::os_service_default # Defaults to $::os_service_default
# #
# [*allow_tls_terminated_listeners*]
# (optional) Boolean if we allow creation of TLS terminated listeners.
# Defaults to $::os_service_default
#
# [*sync_db*] # [*sync_db*]
# (optional) Run octavia-db-manage upgrade head on api nodes after installing the package. # (optional) Run octavia-db-manage upgrade head on api nodes after installing the package.
# Defaults to false # Defaults to false
@@ -42,6 +46,7 @@ class octavia::api (
$port = '9876', $port = '9876',
$auth_strategy = 'keystone', $auth_strategy = 'keystone',
$api_handler = $::os_service_default, $api_handler = $::os_service_default,
$allow_tls_terminated_listeners = $::os_service_default,
$sync_db = false, $sync_db = false,
) inherits octavia::params { ) inherits octavia::params {
@@ -85,6 +90,7 @@ class octavia::api (
'api_settings/bind_port': value => $port; 'api_settings/bind_port': value => $port;
'api_settings/auth_strategy': value => $auth_strategy; 'api_settings/auth_strategy': value => $auth_strategy;
'api_settings/api_handler': value => $api_handler; 'api_settings/api_handler': value => $api_handler;
'api_settings/allow_tls_terminated_listeners': value => $allow_tls_terminated_listeners;
} }
} }

View File

@@ -0,0 +1,5 @@
---
features:
- |
Added new parameter octavia::api::allow_tls_terminated_listeners which can
be used to set the allow_tls_terminated_listeners config option.

View File

@@ -18,6 +18,7 @@ describe 'octavia::api' do
:port => '9876', :port => '9876',
:host => '0.0.0.0', :host => '0.0.0.0',
:api_handler => 'queue_producer', :api_handler => 'queue_producer',
:allow_tls_terminated_listeners => false,
} }
end end
@@ -45,6 +46,7 @@ describe 'octavia::api' do
is_expected.to contain_octavia_config('api_settings/bind_port').with_value( '9876' ) is_expected.to contain_octavia_config('api_settings/bind_port').with_value( '9876' )
is_expected.to contain_octavia_config('api_settings/auth_strategy').with_value( 'keystone' ) is_expected.to contain_octavia_config('api_settings/auth_strategy').with_value( 'keystone' )
is_expected.to contain_octavia_config('api_settings/api_handler').with_value('<SERVICE DEFAULT>') is_expected.to contain_octavia_config('api_settings/api_handler').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('api_settings/allow_tls_terminated_listeners').with_value('<SERVICE DEFAULT>')
end end
it 'does not sync the database' do it 'does not sync the database' do
is_expected.not_to contain_class('octavia::db::sync') is_expected.not_to contain_class('octavia::db::sync')
@@ -55,6 +57,7 @@ describe 'octavia::api' do
is_expected.to contain_octavia_config('api_settings/bind_host').with_value( params[:host] ) is_expected.to contain_octavia_config('api_settings/bind_host').with_value( params[:host] )
is_expected.to contain_octavia_config('api_settings/bind_port').with_value( params[:port] ) is_expected.to contain_octavia_config('api_settings/bind_port').with_value( params[:port] )
is_expected.to contain_octavia_config('api_settings/api_handler').with_value( params[:api_handler] ) is_expected.to contain_octavia_config('api_settings/api_handler').with_value( params[:api_handler] )
is_expected.to contain_octavia_config('api_settings/allow_tls_terminated_listeners').with_value( params[:allow_tls_terminated_listeners] )
end end
[{:enabled => true}, {:enabled => false}].each do |param_hash| [{:enabled => true}, {:enabled => false}].each do |param_hash|