Merge "Expose headers option of apache::vhost"

This commit is contained in:
Zuul 2022-07-30 15:16:12 +00:00 committed by Gerrit Code Review
commit 6b33b3226b
3 changed files with 24 additions and 1 deletions

View File

@ -98,6 +98,14 @@
# (optional) The location of the aodh WSGI script
# Optional. Defaults to $::aodh::params::aodh_wsgi_script_source
#
# [*headers*]
# (optional) Headers for the vhost.
# Defaults to undef
#
# [*request_headers*]
# (optional) Modifies collected request headers in various ways.
# Defaults to undef
#
# [*vhost_custom_fragment*]
# (optional) Passes a string of custom configuration
# directives to be placed at the end of the vhost configuration.
@ -137,6 +145,8 @@ class aodh::wsgi::apache (
$custom_wsgi_process_options = {},
$wsgi_script_dir = $::aodh::params::aodh_wsgi_script_dir,
$wsgi_script_source = $::aodh::params::aodh_wsgi_script_source,
$headers = undef,
$request_headers = undef,
$vhost_custom_fragment = undef,
) inherits aodh::params {
@ -171,6 +181,8 @@ class aodh::wsgi::apache (
wsgi_script_dir => $wsgi_script_dir,
wsgi_script_file => 'app',
wsgi_script_source => $wsgi_script_source,
headers => $headers,
request_headers => $request_headers,
custom_wsgi_process_options => $custom_wsgi_process_options,
access_log_file => $access_log_file,
access_log_format => $access_log_format,

View File

@ -0,0 +1,5 @@
---
features:
- |
The ``aodh::wsgi::apache`` class now supports customizing request/response
headers added by apache.

View File

@ -19,13 +19,15 @@ describe 'aodh::wsgi::apache' do
:wsgi_script_dir => platform_params[:wsgi_script_path],
:wsgi_script_file => 'app',
:wsgi_script_source => platform_params[:wsgi_script_source],
:headers => nil,
:request_headers => nil,
:custom_wsgi_process_options => {},
:access_log_file => false,
:access_log_format => false,
)}
end
context 'when overriding parameters using different ports' do
context 'when overriding parameters' do
let :params do
{
:servername => 'dummy.host',
@ -42,6 +44,8 @@ describe 'aodh::wsgi::apache' do
:error_log_file => '/var/log/httpd/error_log',
:wsgi_script_dir => '/var/lib/openstack/cgi-bin/aodh',
:wsgi_script_source => '/my/path/app.wsgi',
:headers => ['set X-XSS-Protection "1; mode=block"'],
:request_headers => ['set Content-Type "application/json"'],
:vhost_custom_fragment => 'Timeout 99'
}
end
@ -63,6 +67,8 @@ describe 'aodh::wsgi::apache' do
:wsgi_script_dir => '/var/lib/openstack/cgi-bin/aodh',
:wsgi_script_file => 'app',
:wsgi_script_source => '/my/path/app.wsgi',
:headers => ['set X-XSS-Protection "1; mode=block"'],
:request_headers => ['set Content-Type "application/json"'],
:custom_wsgi_process_options => {
'python_path' => '/my/python/path',
},