Add api_workers to puppet-mistral

Currently composable mistral is suffering OOM issues
This param will be used in composable mistral and CI
hopefully reducing OOM issues.

Number of workers for Mistral API service
default is equal to the number of CPUs available if that can
be determined, else a default worker count of 1 is returned.

Also sorted alphabetically this api manifest parameters

Change-Id: I5c3474ebbe0a0296ee24ee66c4d29845ff951cd4
This commit is contained in:
Carlos Camacho
2016-08-11 10:46:56 +02:00
parent 2cd2a93cb0
commit ccc911a29b
2 changed files with 29 additions and 18 deletions

View File

@@ -3,17 +3,17 @@
# Installs & configure the Mistral API service
#
# === Parameters
# [*package_ensure*]
# (Optional) Ensure state for package.
# Defaults to present
#
# [*enabled*]
# (optional) Should the service be enabled.
# Defaults to 'true'.
# [*allow_action_execution_deletion*]
# (Optional) Enables the ability to delete action_execution
# which has no relationship with workflows. (boolean value).
# Defaults to $::os_service_default.
#
# [*manage_service*]
# (optional) Whether the service should be managed by Puppet.
# Defaults to 'true'.
# [*api_workers*]
# (Optional) Number of workers for Mistral API service
# default is equal to the number of CPUs available if that can
# be determined, else a default worker count of 1 is returned.
# Defaults to $::os_service_default
#
# [*bind_host*]
# (Optional) Address to bind the server. Useful when
@@ -24,10 +24,17 @@
# (Optional) The port on which the server will listen.
# Defaults to $::os_service_default.
#
# [*allow_action_execution_deletion*]
# (Optional) Enables the ability to delete action_execution which has no
# relationship with workflows. (boolean value).
# Defaults to $::os_service_default.
# [*enabled*]
# (optional) Should the service be enabled.
# Defaults to 'true'.
#
# [*manage_service*]
# (optional) Whether the service should be managed by Puppet.
# Defaults to 'true'.
#
# [*package_ensure*]
# (Optional) Ensure state for package.
# Defaults to present
#
# [*service_name*]
# (optional) Name of the service that will be providing the
@@ -39,12 +46,13 @@
# Defaults to '$::mistral::params::api_service_name'
#
class mistral::api (
$package_ensure = present,
$manage_service = true,
$enabled = true,
$allow_action_execution_deletion = $::os_service_default,
$api_workers = $::os_service_default,
$bind_host = $::os_service_default,
$bind_port = $::os_service_default,
$allow_action_execution_deletion = $::os_service_default,
$enabled = true,
$manage_service = true,
$package_ensure = present,
$service_name = $::mistral::params::api_service_name,
) inherits mistral::params {
@@ -98,6 +106,7 @@ class mistral::api (
}
mistral_config {
'api/api_workers' : value => $api_workers;
'api/host' : value => $bind_host;
'api/port' : value => $bind_port;
'api/allow_action_execution_deletion' : value => $allow_action_execution_deletion;

View File

@@ -3,7 +3,8 @@ require 'spec_helper'
describe 'mistral::api' do
let :params do
{ :enabled => true,
{ :api_workers => '1',
:enabled => true,
:manage_service => true,
:bind_host => '127.0.0.1',
:bind_port => '1234',
@@ -17,6 +18,7 @@ describe 'mistral::api' do
it { is_expected.to contain_class('mistral::params') }
it { is_expected.to contain_class('mistral::policy') }
it { is_expected.to contain_mistral_config('api/api_workers').with_value( params[:api_workers] ) }
it { is_expected.to contain_mistral_config('api/host').with_value( params[:bind_host] ) }
it { is_expected.to contain_mistral_config('api/port').with_value( params[:bind_port] ) }
it { is_expected.to contain_mistral_config('api/allow_action_execution_deletion').with_value( params[:allow_action_execution_deletion] ) }