]> review.fuel-infra Code Review - puppet-modules/puppet-ceilometer.git/commitdiff
Allow setting log files for apache vhost
authorJuan Antonio Osorio Robles <jaosorior@redhat.com>
Fri, 6 Oct 2017 11:23:31 +0000 (14:23 +0300)
committerJuan Antonio Osorio Robles <jaosorior@redhat.com>
Fri, 6 Oct 2017 11:23:31 +0000 (14:23 +0300)
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: I000ecd05a4ca3b21970b4fa9ca49362c90b072e1

manifests/wsgi/apache.pp
spec/classes/ceilometer_wsgi_apache_spec.rb

index a5969126a5b591a2ccbea616c588c442319833cd..327d4f6ddda50bc5544f321fcb3cb5ad79e7fd0c 100644 (file)
 #   (Optional) apache::vhost ssl parameters.
 #   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.
@@ -107,6 +119,9 @@ class ceilometer::wsgi::apache (
   $wsgi_process_display_name   = undef,
   $threads                     = $::os_workers,
   $priority                    = '10',
+  $access_log_file             = false,
+  $access_log_format           = false,
+  $error_log_file              = undef,
   $custom_wsgi_process_options = {},
 ) {
 
@@ -147,5 +162,8 @@ class ceilometer::wsgi::apache (
     wsgi_script_file            => 'app',
     wsgi_script_source          => $::ceilometer::params::ceilometer_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,
   }
 }
index 3de45beaa1b434898f9dedf0f1e105426b204197..cb79b3784b6e36caf8e7011bbc2daebb5cb43e62 100644 (file)
@@ -27,6 +27,8 @@ describe 'ceilometer::wsgi::apache' do
         :wsgi_script_file            => 'app',
         :wsgi_script_source          => platform_params[:wsgi_script_source],
         :custom_wsgi_process_options => {},
+        :access_log_file             => false,
+        :access_log_format           => false,
       )}
     end
 
@@ -42,6 +44,9 @@ describe 'ceilometer::wsgi::apache' 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
       it { is_expected.to contain_class('ceilometer::deps') }
@@ -68,6 +73,9 @@ describe 'ceilometer::wsgi::apache' 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