Add the aliases param to pass through to apache

This commit adds a new 'aliases' parameter for passing through to
the Apache vhost config.

Change-Id: Ibe841397e064bbda54bddbb83f8885b5451cbd6d
This commit is contained in:
Andy Botting 2020-09-18 10:03:28 +10:00
parent e5c24002f6
commit a2e9ebc745
3 changed files with 18 additions and 0 deletions

View File

@ -161,6 +161,10 @@
# (Optional) Headers for the vhost.
# Defaults to undef
#
# [*aliases*]
# (Optional) Aliases for the vhost.
# Defaults to undef
#
# [*custom_wsgi_process_options*]
# (Optional) gives you the oportunity to add custom process options or to
# overwrite the default options for the WSGI process.
@ -252,6 +256,7 @@ define openstacklib::wsgi::apache (
$wsgi_import_script = undef,
$wsgi_import_script_options = undef,
$headers = undef,
$aliases = undef,
$custom_wsgi_process_options = {},
$custom_wsgi_script_aliases = undef,
$vhost_custom_fragment = undef,
@ -361,6 +366,7 @@ define openstacklib::wsgi::apache (
wsgi_import_script => $wsgi_import_script_real,
wsgi_import_script_options => $wsgi_import_script_options_real,
headers => $headers,
aliases => $aliases,
custom_fragment => $vhost_custom_fragment,
allow_encoded_slashes => $allow_encoded_slashes,
access_log_file => $access_log_file,

View File

@ -0,0 +1,5 @@
---
features:
- |
The new ``openstacklib::wsgi::apache::aliases`` parameter has been added.
This parameter can be used to add alias definitions to the httpd vhost.

View File

@ -88,6 +88,7 @@ describe 'openstacklib::wsgi::apache' do
:wsgi_script_aliases => { '/' => "/var/www/cgi-bin/keystone/main" },
:wsgi_application_group => '%{GLOBAL}',
:headers => nil,
:aliases => nil,
:setenvif => ['X-Forwarded-Proto https HTTPS=1'],
:access_log_file => false,
:access_log_pipe => false,
@ -112,6 +113,9 @@ describe 'openstacklib::wsgi::apache' do
:wsgi_chunked_request => 'On',
:custom_wsgi_script_aliases => { '/admin' => '/var/www/cgi-bin/keystone/admin' },
:headers => 'set X-Frame-Options "DENY"',
:aliases => [
{ 'alias' => '/robots.txt', 'path' => '/etc/keystone/robots.txt', },
],
:servername => 'dummy.host',
:bind_host => '10.42.51.1',
:bind_port => 4142,
@ -154,6 +158,9 @@ describe 'openstacklib::wsgi::apache' do
:wsgi_pass_authorization => 'On',
:wsgi_chunked_request => 'On',
:headers => 'set X-Frame-Options "DENY"',
:aliases => [
{ 'alias' => '/robots.txt', 'path' => '/etc/keystone/robots.txt', }
],
:custom_fragment => 'LimitRequestFieldSize 81900',
:allow_encoded_slashes => 'on',
:access_log_file => '/var/log/httpd/access_log',