Allow setting log files for apache vhost

This allows the setting of the error and access file logs, as well as
the access log format. This was done in a similar fashion as one can
configure these ones in the keystone wsgi manifest.

Change-Id: Id64898df6389ee7d00c8d14841ee5d999e84fee3
This commit is contained in:
Juan Antonio Osorio Robles 2017-10-06 14:23:59 +03:00
parent c00a1b88ba
commit 5a71880b54
3 changed files with 32 additions and 0 deletions

View File

@ -66,6 +66,18 @@
# apache::vhost ssl parameters.
# Optional. Default to apache::vhost 'ssl_*' defaults.
#
# [*access_log_file*]
# The log file name for the virtualhost.
# Optional. Defaults to false.
#
# [*access_log_format*]
# The log format for the virtualhost.
# Optional. Defaults to false.
#
# [*error_log_file*]
# The error log file name for the virtualhost.
# Optional. Defaults to undef.
#
# == Dependencies
#
# requires Class['apache'] & Class['ironic']
@ -94,6 +106,9 @@ class ironic::wsgi::apache (
$wsgi_process_display_name = undef,
$threads = $::os_workers,
$priority = '10',
$access_log_file = false,
$access_log_format = false,
$error_log_file = undef,
) {
include ::ironic::deps
@ -128,5 +143,8 @@ class ironic::wsgi::apache (
wsgi_script_dir => $::ironic::params::ironic_wsgi_script_path,
wsgi_script_file => 'app',
wsgi_script_source => $::ironic::params::ironic_wsgi_script_source,
access_log_file => $access_log_file,
access_log_format => $access_log_format,
error_log_file => $error_log_file,
}
}

View File

@ -0,0 +1,6 @@
---
features:
- |
It is now possible to configure the access log (through the
``access_log_file`` and ``access_log_format`` variables) and the error log
file path (through the error_log_file variable) in the apache vhost.

View File

@ -22,6 +22,8 @@ describe 'ironic::wsgi::apache' do
:wsgi_script_dir => platform_params[:wsgi_script_path],
:wsgi_script_file => 'app',
:wsgi_script_source => platform_params[:wsgi_script_source],
:access_log_file => false,
:access_log_format => false,
)}
end
@ -34,6 +36,9 @@ describe 'ironic::wsgi::apache' do
:ssl => false,
:wsgi_process_display_name => 'ironic',
:workers => 37,
:access_log_file => '/var/log/httpd/access_log',
:access_log_format => 'some format',
:error_log_file => '/var/log/httpd/error_log'
}
end
it { is_expected.to contain_class('ironic::params') }
@ -56,6 +61,9 @@ describe 'ironic::wsgi::apache' do
:wsgi_script_dir => platform_params[:wsgi_script_path],
:wsgi_script_file => 'app',
:wsgi_script_source => platform_params[:wsgi_script_source],
:access_log_file => '/var/log/httpd/access_log',
:access_log_format => 'some format',
:error_log_file => '/var/log/httpd/error_log'
)}
end
end