diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index 953d412c..d931d727 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -154,6 +154,18 @@ # underlying vhost resource. # Defaults to undef. # +# [*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. +# define openstacklib::wsgi::apache ( $service_name = $name, $bind_host = undef, @@ -185,6 +197,9 @@ define openstacklib::wsgi::apache ( $custom_wsgi_process_options = {}, $vhost_custom_fragment = undef, $allow_encoded_slashes = undef, + $access_log_file = false, + $access_log_format = false, + $error_log_file = undef, ) { include ::apache @@ -253,6 +268,9 @@ define openstacklib::wsgi::apache ( wsgi_chunked_request => $wsgi_chunked_request, custom_fragment => $vhost_custom_fragment, allow_encoded_slashes => $allow_encoded_slashes, + access_log_file => $access_log_file, + access_log_format => $access_log_format, + error_log_file => $error_log_file, } Package<| title == 'httpd' |> diff --git a/spec/defines/openstacklib_wsgi_apache_spec.rb b/spec/defines/openstacklib_wsgi_apache_spec.rb index 8371a116..7eee298d 100644 --- a/spec/defines/openstacklib_wsgi_apache_spec.rb +++ b/spec/defines/openstacklib_wsgi_apache_spec.rb @@ -37,7 +37,9 @@ describe 'openstacklib::wsgi::apache' do :user => 'keystone', :wsgi_script_dir => '/var/www/cgi-bin/keystone', :wsgi_script_file => 'main', - :wsgi_script_source => '/usr/share/keystone/keystone.wsgi' + :wsgi_script_source => '/usr/share/keystone/keystone.wsgi', + :access_log_file => false, + :access_log_format => false, } end @@ -83,7 +85,9 @@ describe 'openstacklib::wsgi::apache' do 'display-name' => 'keystone_wsgi', }, 'wsgi_application_group' => '%{GLOBAL}', - 'setenvif' => ['X-Forwarded-Proto https HTTPS=1'] + 'setenvif' => ['X-Forwarded-Proto https HTTPS=1'], + 'access_log_file' => false, + 'access_log_format' => false, )} it { is_expected.to contain_concat("#{platform_params[:httpd_ports_file]}") } end @@ -105,6 +109,9 @@ describe 'openstacklib::wsgi::apache' do :workers => 37, :vhost_custom_fragment => 'LimitRequestFieldSize 81900', :allow_encoded_slashes => 'on', + :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_apache__vhost('keystone_wsgi').with( @@ -127,7 +134,10 @@ describe 'openstacklib::wsgi::apache' do 'wsgi_pass_authorization' => 'On', 'wsgi_chunked_request' => 'On', 'custom_fragment' => 'LimitRequestFieldSize 81900', - 'allow_encoded_slashes' => 'on', + 'allow_encoded_slashes' => 'on', + 'access_log_file' => '/var/log/httpd/access_log', + 'access_log_format' => 'some format', + 'error_log_file' => '/var/log/httpd/error_log' )} end