From a2e9ebc745bf2722e83c11e6dad69b98af179c2f Mon Sep 17 00:00:00 2001 From: Andy Botting Date: Fri, 18 Sep 2020 10:03:28 +1000 Subject: [PATCH] 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 --- manifests/wsgi/apache.pp | 6 ++++++ releasenotes/notes/wsgi-aliases-2f74cbb84fcfd706.yaml | 5 +++++ spec/defines/openstacklib_wsgi_apache_spec.rb | 7 +++++++ 3 files changed, 18 insertions(+) create mode 100644 releasenotes/notes/wsgi-aliases-2f74cbb84fcfd706.yaml diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index 6d9e0f70..8477c446 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -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, diff --git a/releasenotes/notes/wsgi-aliases-2f74cbb84fcfd706.yaml b/releasenotes/notes/wsgi-aliases-2f74cbb84fcfd706.yaml new file mode 100644 index 00000000..1fdd49c6 --- /dev/null +++ b/releasenotes/notes/wsgi-aliases-2f74cbb84fcfd706.yaml @@ -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. diff --git a/spec/defines/openstacklib_wsgi_apache_spec.rb b/spec/defines/openstacklib_wsgi_apache_spec.rb index 4acf5589..05e903f5 100644 --- a/spec/defines/openstacklib_wsgi_apache_spec.rb +++ b/spec/defines/openstacklib_wsgi_apache_spec.rb @@ -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',