From 5a71880b54533a049adb9f203a241a22b123dd62 Mon Sep 17 00:00:00 2001 From: Juan Antonio Osorio Robles Date: Fri, 6 Oct 2017 14:23:59 +0300 Subject: [PATCH] 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 --- manifests/wsgi/apache.pp | 18 ++++++++++++++++++ ...s-and-error-log-files-0181077a3d0e9d20.yaml | 6 ++++++ spec/classes/ironic_wsgi_apache_spec.rb | 8 ++++++++ 3 files changed, 32 insertions(+) create mode 100644 releasenotes/notes/configure-access-and-error-log-files-0181077a3d0e9d20.yaml diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index dd6ba2d8..0056ef51 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -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, } } diff --git a/releasenotes/notes/configure-access-and-error-log-files-0181077a3d0e9d20.yaml b/releasenotes/notes/configure-access-and-error-log-files-0181077a3d0e9d20.yaml new file mode 100644 index 00000000..5f2a7d42 --- /dev/null +++ b/releasenotes/notes/configure-access-and-error-log-files-0181077a3d0e9d20.yaml @@ -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. diff --git a/spec/classes/ironic_wsgi_apache_spec.rb b/spec/classes/ironic_wsgi_apache_spec.rb index ce3b3d7f..1be44112 100644 --- a/spec/classes/ironic_wsgi_apache_spec.rb +++ b/spec/classes/ironic_wsgi_apache_spec.rb @@ -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