diff --git a/manifests/api.pp b/manifests/api.pp index 9cd13e46..f76dd867 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -42,6 +42,10 @@ # HTTPProxyToWSGI middleware. # Defaults to $::os_service_default. # +# [*max_request_body_size*] +# (Optional) Set max request body size +# Defaults to $::os_service_default. +# # [*middlewares*] # (optional) Middlewares to use. # Defaults to $::os_service_default @@ -55,6 +59,7 @@ class gnocchi::api ( $sync_db = false, $auth_strategy = 'keystone', $enable_proxy_headers_parsing = $::os_service_default, + $max_request_body_size = $::os_service_default, $middlewares = $::os_service_default, ) inherits gnocchi::params { @@ -114,6 +119,7 @@ standalone service, or httpd for being run by a httpd server") oslo::middleware { 'gnocchi_config': enable_proxy_headers_parsing => $enable_proxy_headers_parsing, + max_request_body_size => $max_request_body_size, } if $auth_strategy == 'keystone' { diff --git a/releasenotes/notes/max_request_body_size-99d457dd976374cc.yaml b/releasenotes/notes/max_request_body_size-99d457dd976374cc.yaml new file mode 100644 index 00000000..f29fec52 --- /dev/null +++ b/releasenotes/notes/max_request_body_size-99d457dd976374cc.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Add support to configure `[oslo_middleware]/max_request_body_size` with + `$max_request_body_size`. diff --git a/spec/classes/gnocchi_api_spec.rb b/spec/classes/gnocchi_api_spec.rb index 96d03a66..21f84330 100644 --- a/spec/classes/gnocchi_api_spec.rb +++ b/spec/classes/gnocchi_api_spec.rb @@ -63,6 +63,7 @@ describe 'gnocchi::api' do is_expected.to contain_gnocchi_config('api/middlewares').with_value('') is_expected.to contain_oslo__middleware('gnocchi_config').with( :enable_proxy_headers_parsing => '', + :max_request_body_size => '', ) end @@ -165,6 +166,16 @@ describe 'gnocchi::api' do )} end + context 'with max_request_body_size' do + before do + params.merge!({:max_request_body_size => '102400' }) + end + + it { is_expected.to contain_oslo__middleware('gnocchi_config').with( + :max_request_body_size => '102400', + )} + end + end on_supported_os({