Pass custom_wsgi_process_options to horizon::wsgi::apache

This adds the custom_wsgi_process_options parameter to
the horizon class that is passed down to the
horizon::wsgi::apache class when configure_apache is
set to true.

Change-Id: I986aeb9766a777eaf82f1f2fccfed95b380dc4c7
(cherry picked from commit cd5216f5a5)
(cherry picked from commit 0613e18b33)
This commit is contained in:
Tobias Urdin 2024-10-28 15:05:32 +01:00
parent 8045182a74
commit 83e324363d
3 changed files with 48 additions and 30 deletions

View File

@ -257,6 +257,14 @@
# (optional) Number of thread to run in a Horizon process # (optional) Number of thread to run in a Horizon process
# Defaults to '1' # Defaults to '1'
# #
# [*custom_wsgi_process_options*]
# (optional) gives you the opportunity to add custom process options or to
# overwrite the default options for the WSGI main process.
# eg. to use a virtual python environment for the WSGI process
# you could set it to:
# { python-path => '/my/python/virtualenv' }
# Defaults to {}
#
# [*vhost_extra_params*] # [*vhost_extra_params*]
# (optional) extra parameter to pass to the apache::vhost class # (optional) extra parameter to pass to the apache::vhost class
# Defaults to undef # Defaults to undef
@ -592,6 +600,7 @@ class horizon(
$ssl_verify_client = undef, $ssl_verify_client = undef,
$wsgi_processes = $facts['os_workers'], $wsgi_processes = $facts['os_workers'],
$wsgi_threads = '1', $wsgi_threads = '1',
$custom_wsgi_process_options = {},
Boolean $compress_enabled = true, Boolean $compress_enabled = true,
Boolean $compress_offline = true, Boolean $compress_offline = true,
# TODO(tkajinam) Consider adding more strict validation about key-value # TODO(tkajinam) Consider adding more strict validation about key-value
@ -766,6 +775,7 @@ Use PyMemcacheCache backend instead")
ssl_verify_client => $ssl_verify_client, ssl_verify_client => $ssl_verify_client,
wsgi_processes => $wsgi_processes, wsgi_processes => $wsgi_processes,
wsgi_threads => $wsgi_threads, wsgi_threads => $wsgi_threads,
custom_wsgi_process_options => $custom_wsgi_process_options,
extra_params => $vhost_extra_params, extra_params => $vhost_extra_params,
redirect_type => $redirect_type, redirect_type => $redirect_type,
root_url => $root_url, root_url => $root_url,

View File

@ -0,0 +1,5 @@
features:
- |
Added ``horizon::custom_wsgi_process_options`` parameter that is passed
down to the ``horizon::wsgi::apache`` class when ``configure_apache``
is set to true.

View File

@ -39,6 +39,7 @@ describe 'horizon' do
:listen_ssl => false, :listen_ssl => false,
:wsgi_processes => facts[:os_workers], :wsgi_processes => facts[:os_workers],
:wsgi_threads => '1', :wsgi_threads => '1',
:custom_wsgi_process_options => {},
:extra_params => {}, :extra_params => {},
:redirect_type => 'permanent', :redirect_type => 'permanent',
}) })
@ -368,12 +369,14 @@ describe 'horizon' do
before do before do
params.merge!( :wsgi_processes => '30', params.merge!( :wsgi_processes => '30',
:wsgi_threads => '5', :wsgi_threads => '5',
:custom_wsgi_process_options => { 'python-env' => '/tmp/test' },
:access_log_format => 'common' ) :access_log_format => 'common' )
end end
it { should contain_class('horizon::wsgi::apache').with( it { should contain_class('horizon::wsgi::apache').with(
:wsgi_processes => '30', :wsgi_processes => '30',
:wsgi_threads => '5', :wsgi_threads => '5',
:custom_wsgi_process_options => { 'python-env' => '/tmp/test' },
:access_log_format => 'common', :access_log_format => 'common',
)} )}
end end