Merge "Expose headers option of apache::vhost"

This commit is contained in:
Zuul 2022-07-30 15:00:41 +00:00 committed by Gerrit Code Review
commit 0d936a4a33
3 changed files with 28 additions and 5 deletions

View File

@ -85,6 +85,14 @@
# { python-path => '/my/python/virtualenv' }
# Defaults to {}
#
# [*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.
@ -116,6 +124,8 @@ class designate::wsgi::apache (
$access_log_format = false,
$error_log_file = undef,
$custom_wsgi_process_options = {},
$headers = undef,
$request_headers = undef,
$vhost_custom_fragment = undef,
) {
@ -149,6 +159,8 @@ class designate::wsgi::apache (
wsgi_script_dir => $::designate::params::designate_wsgi_script_path,
wsgi_script_file => 'app',
wsgi_script_source => $::designate::params::designate_wsgi_script_source,
headers => $headers,
request_headers => $request_headers,
access_log_file => $access_log_file,
access_log_format => $access_log_format,
error_log_file => $error_log_file,

View File

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

View File

@ -19,13 +19,15 @@ describe 'designate::wsgi::apache' do
:wsgi_script_dir => platform_params[:wsgi_script_path],
:wsgi_script_file => 'app',
:wsgi_script_source => platform_params[:wsgi_script_source],
:custom_wsgi_process_options => {},
:access_log_file => false,
:access_log_format => false,
:custom_wsgi_process_options => {},
:headers => nil,
:request_headers => nil,
)}
end
context 'when overriding parameters using different ports' do
context 'when overriding parameters' do
let :params do
{
:servername => 'dummy.host',
@ -34,12 +36,14 @@ describe 'designate::wsgi::apache' do
:ssl => true,
:wsgi_process_display_name => 'designate',
:workers => 37,
:custom_wsgi_process_options => {
'python_path' => '/my/python/path',
},
:access_log_file => '/var/log/httpd/access_log',
:access_log_format => 'some format',
:error_log_file => '/var/log/httpd/error_log',
:custom_wsgi_process_options => {
'python_path' => '/my/python/path',
},
:headers => ['set X-XSS-Protection "1; mode=block"'],
:request_headers => ['set Content-Type "application/json"'],
:vhost_custom_fragment => 'Timeout 99'
}
end
@ -61,6 +65,8 @@ describe 'designate::wsgi::apache' do
:wsgi_script_dir => platform_params[:wsgi_script_path],
:wsgi_script_file => 'app',
:wsgi_script_source => platform_params[:wsgi_script_source],
:headers => ['set X-XSS-Protection "1; mode=block"'],
:request_headers => ['set Content-Type "application/json"'],
:custom_wsgi_process_options => {
'python_path' => '/my/python/path',
},