From 30edd5b793651135d6729c007f82ab020132b747 Mon Sep 17 00:00:00 2001 From: Juan Antonio Osorio Robles Date: Tue, 3 Oct 2017 14:23:32 +0300 Subject: [PATCH] Allow setting log files for nova-placement 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: I59d02fe8731c20c64ca389000f12c78cfc1f12be --- manifests/wsgi/apache_placement.pp | 18 ++++++++++++++++++ .../classes/nova_wsgi_apache_placement_spec.rb | 9 +++++++++ 2 files changed, 27 insertions(+) diff --git a/manifests/wsgi/apache_placement.pp b/manifests/wsgi/apache_placement.pp index e552f8a70..ef4b8b32f 100644 --- a/manifests/wsgi/apache_placement.pp +++ b/manifests/wsgi/apache_placement.pp @@ -72,6 +72,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. +# # [*custom_wsgi_process_options*] # (optional) gives you the oportunity to add custom process options or to # overwrite the default options for the WSGI main process. @@ -104,6 +116,9 @@ class nova::wsgi::apache_placement ( $threads = $::os_workers, $priority = '10', $ensure_package = 'present', + $access_log_file = false, + $access_log_format = false, + $error_log_file = undef, $custom_wsgi_process_options = {}, ) { @@ -160,6 +175,9 @@ class nova::wsgi::apache_placement ( wsgi_script_file => 'nova-placement-api', wsgi_script_source => $::nova::params::placement_wsgi_script_source, custom_wsgi_process_options => $custom_wsgi_process_options, + access_log_file => $access_log_file, + access_log_format => $access_log_format, + error_log_file => $error_log_file, } } diff --git a/spec/classes/nova_wsgi_apache_placement_spec.rb b/spec/classes/nova_wsgi_apache_placement_spec.rb index 183213be9..ae4f90552 100644 --- a/spec/classes/nova_wsgi_apache_placement_spec.rb +++ b/spec/classes/nova_wsgi_apache_placement_spec.rb @@ -37,6 +37,9 @@ describe 'nova::wsgi::apache_placement' do :wsgi_script_file => 'nova-placement-api', :wsgi_script_source => platform_params[:placement_wsgi_script_source], :custom_wsgi_process_options => {}, + :access_log_file => false, + :access_log_format => false, + :error_log_file => nil, )} end @@ -61,6 +64,9 @@ describe 'nova::wsgi::apache_placement' do :custom_wsgi_process_options => { 'python_path' => '/my/python/path', }, + :access_log_file => '/var/log/httpd/access_log', + :access_log_format => 'some format', + :error_log_file => '/var/log/httpd/error_log' } end @@ -93,6 +99,9 @@ describe 'nova::wsgi::apache_placement' do :custom_wsgi_process_options => { 'python_path' => '/my/python/path', }, + :access_log_file => '/var/log/httpd/access_log', + :access_log_format => 'some format', + :error_log_file => '/var/log/httpd/error_log' )} end end