diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index f4aba7e16..355404f89 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -47,16 +47,16 @@ # Optional. Defaults to $facts['os_workers'] # # [*priority*] -# (optional) The priority for the vhost. -# Defaults to 10 +# The priority for the vhost. +# Optional. Defaults to 10 # # [*threads*] -# (optional) The number of threads for the vhost. -# Defaults to 1 +# The number of threads for the vhost. +# Optional. Defaults to 1 # # [*wsgi_process_display_name*] -# (optional) Name of the WSGI process display-name. -# Defaults to undef +# Name of the WSGI process display-name. +# Optional. Defaults to undef # # [*ssl_cert*] # [*ssl_key*] @@ -84,6 +84,11 @@ # The log format for the virtualhost. # Optional. Defaults to undef. # +# [*access_log_env_var*] +# Specifies that only requests with particular +# environment variables be logged. +# Optional. Defaults to undef +# # [*error_log_file*] # The error log file name for the virtualhost. # Optional. Defaults to undef. @@ -97,20 +102,20 @@ # Optional. Defaults to undef. # # [*custom_wsgi_process_options*] -# (optional) gives you the opportunity to add custom process options or to +# Gives you the opportunity to add custom process options or to # overwrite the default options for the WSGI main process. # eg. to use a virtual python environment for the WSGI process # you could set it to: # { python-path => '/my/python/virtualenv' } -# Defaults to {} +# Optional. Defaults to {} # # [*headers*] -# (optional) Headers for the vhost. -# Defaults to undef +# Headers for the vhost. +# Optional. Defaults to undef # # [*request_headers*] -# (optional) Modifies collected request headers in various ways. -# Defaults to undef +# Modifies collected request headers in various ways. +# Optional. Defaults to undef # # == Dependencies # @@ -143,6 +148,7 @@ class neutron::wsgi::apache ( $access_log_pipe = undef, $access_log_syslog = undef, $access_log_format = undef, + $access_log_env_var = undef, $error_log_file = undef, $error_log_pipe = undef, $error_log_syslog = undef, @@ -187,6 +193,7 @@ class neutron::wsgi::apache ( access_log_pipe => $access_log_pipe, access_log_syslog => $access_log_syslog, access_log_format => $access_log_format, + access_log_env_var => $access_log_env_var, error_log_file => $error_log_file, error_log_pipe => $error_log_pipe, error_log_syslog => $error_log_syslog, diff --git a/releasenotes/notes/access_log_env_var-ae5ffafbe38c3ae1.yaml b/releasenotes/notes/access_log_env_var-ae5ffafbe38c3ae1.yaml new file mode 100644 index 000000000..a89e4d9dc --- /dev/null +++ b/releasenotes/notes/access_log_env_var-ae5ffafbe38c3ae1.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Add the ``access_log_env_var`` parameter to the ``neutron::wsgi::apache`` + class to allow filtering logs (eg. suppress healthecks) diff --git a/spec/classes/neutron_wsgi_apache_spec.rb b/spec/classes/neutron_wsgi_apache_spec.rb index 0a36ca2e6..3cc13abf8 100644 --- a/spec/classes/neutron_wsgi_apache_spec.rb +++ b/spec/classes/neutron_wsgi_apache_spec.rb @@ -26,6 +26,7 @@ describe 'neutron::wsgi::apache' do :access_log_pipe => nil, :access_log_syslog => nil, :access_log_format => nil, + :access_log_env_var => nil, :error_log_file => nil, :error_log_pipe => nil, :error_log_syslog => nil, @@ -76,16 +77,18 @@ describe 'neutron::wsgi::apache' do context 'with custom access logging' do let :params do { - :access_log_format => 'foo', - :access_log_syslog => 'syslog:local0', - :error_log_syslog => 'syslog:local1', + :access_log_format => 'foo', + :access_log_syslog => 'syslog:local0', + :error_log_syslog => 'syslog:local1', + :access_log_env_var => '!dontlog', } end it { should contain_openstacklib__wsgi__apache('neutron_wsgi').with( - :access_log_format => params[:access_log_format], - :access_log_syslog => params[:access_log_syslog], - :error_log_syslog => params[:error_log_syslog], + :access_log_format => params[:access_log_format], + :access_log_syslog => params[:access_log_syslog], + :error_log_syslog => params[:error_log_syslog], + :access_log_env_var => params[:access_log_env_var], )} end