diff --git a/manifests/api.pp b/manifests/api.pp index 9357bee7..95eba68e 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -56,6 +56,10 @@ # (optional) Defines the enabled share protocols provided by Manila. # Defaults to $::os_service_default # +# [*service_workers*] +# (optional) Number of manila-api workers +# Defaults to $::os_workers +# # === DEPRECATED PARAMTERS # # [*service_port*] @@ -75,6 +79,7 @@ class manila::api ( $ratelimits_factory = 'manila.api.v1.limits:RateLimitingMiddleware.factory', $enable_proxy_headers_parsing = $::os_service_default, $enabled_share_protocols = $::os_service_default, + $service_workers = $::os_workers, # Deprecated $service_port = undef, ) { @@ -126,6 +131,7 @@ class manila::api ( 'DEFAULT/osapi_share_listen': value => $bind_host; 'DEFAULT/enabled_share_protocols': value => $enabled_share_protocols; 'DEFAULT/default_share_type': value => $default_share_type; + 'DEFAULT/osapi_share_workers': value => $service_workers; } oslo::middleware { 'manila_config': diff --git a/releasenotes/notes/add_service_workers_option-1c0728975b024eac.yaml b/releasenotes/notes/add_service_workers_option-1c0728975b024eac.yaml new file mode 100644 index 00000000..1c0fba52 --- /dev/null +++ b/releasenotes/notes/add_service_workers_option-1c0728975b024eac.yaml @@ -0,0 +1,3 @@ +--- +features: + - Add service_workers option to configure the number of API workers diff --git a/spec/classes/manila_api_spec.rb b/spec/classes/manila_api_spec.rb index 2caa6e76..ff0ce3e8 100644 --- a/spec/classes/manila_api_spec.rb +++ b/spec/classes/manila_api_spec.rb @@ -33,6 +33,7 @@ describe 'manila::api' do is_expected.to_not contain_manila_config('DEFAULT/os_region_name') is_expected.to contain_manila_config('oslo_middleware/enable_proxy_headers_parsing').with_value('') is_expected.to contain_manila_config('DEFAULT/default_share_type').with(:value => '') + is_expected.to contain_manila_config('DEFAULT/osapi_share_workers').with(:value => '2') end it 'should run db sync' do @@ -62,6 +63,17 @@ describe 'manila::api' do end end + describe 'with service workers' do + let :params do + req_params.merge({'service_workers' => '4'}) + end + it 'should configure the share workers' do + is_expected.to contain_manila_config('DEFAULT/osapi_share_workers').with( + :value => '4' + ) + end + end + describe 'with only required params' do let :params do req_params.merge({'bind_host' => '192.168.1.3'})