From 963e0a96107e324c2979686c8e0f8fb36b7c0ebc Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 9 May 2022 12:06:15 +0900 Subject: [PATCH] Support customizing log file names for apache vhosts ... instead of requiring the hard-coded names. Related-Bug: #1575329 Change-Id: Ie3641371d3d5752115c33be50a0ab4c86989797d --- manifests/wsgi/apache.pp | 28 ++++++++++++++++--- .../apache-log-files-8474bbad1411ba51.yaml | 5 ++++ 2 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/apache-log-files-8474bbad1411ba51.yaml diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index 9ceff42e..b0b17e5e 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -101,6 +101,22 @@ # (optional) The log format to use to the access log. # Defaults to false # +# [*access_log_file*] +# (optional) The log file name for the virtualhost. +# Defaults to 'horizon_access.log' +# +# [*error_log_file*] +# (optional) The error log file name for the virtualhost. +# Defaults to 'horizon_error.log' +# +# [*ssl_access_log_file*] +# (optional) The log file name for the ssl virtualhost. +# Defaults to 'horizon_ssl_access.log' +# +# [*ssl_error_log_file*] +# (optional) The error log file name for the ssl virtualhost. +# Defaults to 'horizon_ssl_error.log' +# class horizon::wsgi::apache ( $bind_address = undef, $servername = $::fqdn, @@ -125,6 +141,10 @@ class horizon::wsgi::apache ( $root_url = $::horizon::params::root_url, $root_path = "${::horizon::params::static_path}/openstack-dashboard", $access_log_format = false, + $access_log_file = 'horizon_access.log', + $error_log_file = 'horizon_error.log', + $ssl_access_log_file = 'horizon_ssl_access.log', + $ssl_error_log_file = 'horizon_ssl_error.log', ) inherits horizon::params { include horizon::deps @@ -240,9 +260,9 @@ class horizon::wsgi::apache ( servername => $servername, serveraliases => any2array($server_aliases), docroot => '/var/www/', - access_log_file => 'horizon_access.log', + access_log_file => $access_log_file, access_log_format => $access_log_format, - error_log_file => 'horizon_error.log', + error_log_file => $error_log_file, priority => $priority, aliases => [{ alias => "${root_url_real}/static", @@ -302,8 +322,8 @@ class horizon::wsgi::apache ( wsgi_daemon_process => hash(['horizon-ssl', $wsgi_daemon_process_options]), }, { - access_log_file => 'horizon_ssl_access.log', - error_log_file => 'horizon_ssl_error.log', + access_log_file => $ssl_access_log_file, + error_log_file => $ssl_error_log_file, priority => $priority, ssl => true, port => $https_port, diff --git a/releasenotes/notes/apache-log-files-8474bbad1411ba51.yaml b/releasenotes/notes/apache-log-files-8474bbad1411ba51.yaml new file mode 100644 index 00000000..3849a2e5 --- /dev/null +++ b/releasenotes/notes/apache-log-files-8474bbad1411ba51.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The ``horizon::wsgi::apache`` class now supports customizing name of vhost + log files.