Add storage related params

Change-Id: I5ab26687f58904eeeb2386c09725bbd2970dbb48
This commit is contained in:
Xingchao Yu 2017-04-19 12:10:32 +08:00
parent 1debc566de
commit 3b9cd459ce
3 changed files with 42 additions and 6 deletions

View File

@ -54,6 +54,23 @@
# HTTPProxyToWSGI middleware.
# Defaults to $::os_service_default.
#
# [*max_retries*]
# (Optional) Maximum number of connection retries during startup.
# Set to -1 to specify an infinite retry count. (integer value)
# Defaults to $::os_service_default.
#
# [*retry_interval*]
# (Optional) Interval between retries of connection.
# Defaults to $::os_service_default.
#
# [*es_ssl_enabled*]
# (Optional) Enable HTTPS connection in the Elasticsearch connection.
# Defaults to $::os_service_default.
#
# [*es_index_name*]
# (Optional) The name of the index in Elasticsearch (string value).
# Defaults to $::os_service_default.
#
class panko::api (
$manage_service = true,
$enabled = true,
@ -66,6 +83,10 @@ class panko::api (
$sync_db = false,
$auth_strategy = 'keystone',
$enable_proxy_headers_parsing = $::os_service_default,
$max_retries = $::os_service_default,
$retry_interval = $::os_service_default,
$es_ssl_enabled = $::os_service_default,
$es_index_name = $::os_service_default,
) inherits panko::params {
include ::panko::deps
@ -117,10 +138,14 @@ running as a standalone service, or httpd for being run by a httpd server")
}
panko_config {
'api/host': value => $host;
'api/port': value => $port;
'api/workers': value => $workers;
'api/max_limit': value => $max_limit;
'api/host': value => $host;
'api/port': value => $port;
'api/workers': value => $workers;
'api/max_limit': value => $max_limit;
'storage/max_retries': value => $max_retries;
'storage/retry_interval': value => $retry_interval;
'storage/es_ssl_enabled': value => $es_ssl_enabled;
'storage/es_index_name': value => $es_index_name;
}
if $auth_strategy == 'keystone' {

View File

@ -0,0 +1,3 @@
---
features:
- This adds storage releated parameters in panko-api service.

View File

@ -17,6 +17,10 @@ describe 'panko::api' do
:port => '8779',
:max_limit => '1000',
:host => '0.0.0.0',
:max_retries => '10',
:retry_interval => '20',
:es_ssl_enabled => true,
:es_index_name => 'panko',
}
end
@ -39,6 +43,10 @@ describe 'panko::api' do
is_expected.to contain_panko_config('api/port').with_value( params[:port] )
is_expected.to contain_panko_config('api/max_limit').with_value( params[:max_limit] )
is_expected.to contain_panko_config('api/workers').with_value('2')
is_expected.to contain_panko_config('storage/max_retries').with_value(params[:max_retries])
is_expected.to contain_panko_config('storage/retry_interval').with_value(params[:retry_interval])
is_expected.to contain_panko_config('storage/es_ssl_enabled').with_value(params[:es_ssl_enabled])
is_expected.to contain_panko_config('storage/es_index_name').with_value(params[:es_index_name])
is_expected.to contain_panko_config('oslo_middleware/enable_proxy_headers_parsing').with_value('<SERVICE DEFAULT>')
end
@ -108,8 +116,8 @@ describe 'panko::api' do
include ::panko::db
class { 'panko': }
class {'panko::keystone::authtoken':
password => 'password',
}"
password => 'password',
}"
end
it 'configures panko-api service with Apache' do