Mobrovac has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/268847

Change subject: Zotero: Move logs to /srv/log
......................................................................

Zotero: Move logs to /srv/log

On SC(A|B), the /srv partition is much bigger than /, so move Zotero's
logs there.

Note: instead of hard-coding the path, this patch leverages the
configuration set for ::service::configuration (which for both SCA and
SCB is set to /srv/log).

Bug: T107900
Change-Id: I8527a4e72f7b8b8d9c188c755feb0d01dff5debb
---
M modules/zotero/manifests/init.pp
M modules/zotero/templates/logrotate.erb
M modules/zotero/templates/upstart.erb
3 files changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/47/268847/1

diff --git a/modules/zotero/manifests/init.pp b/modules/zotero/manifests/init.pp
index efee1d9..313e1e4 100644
--- a/modules/zotero/manifests/init.pp
+++ b/modules/zotero/manifests/init.pp
@@ -11,6 +11,8 @@
 #
 class zotero( $http_proxy = undef ) {
 
+    include ::service::configuration
+
     if $http_proxy =~ /:/ {
         $http_proxy_port = regsubst($http_proxy, '.*:', '')
         $http_proxy_host = regsubst($http_proxy, ':.*', '')
@@ -18,6 +20,8 @@
         $http_proxy_port = undef
         $http_proxy_host = undef
     }
+
+    $log_dir = $::service::configuration::log_dir
 
     package { 'xulrunner-dev':
         ensure => present,
@@ -57,7 +61,7 @@
         system => true,
     }
 
-    file { '/var/log/zotero':
+    file { "${log_dir}/zotero":
         ensure => directory,
         owner  => 'zotero',
         group  => 'zotero',
diff --git a/modules/zotero/templates/logrotate.erb 
b/modules/zotero/templates/logrotate.erb
index 4303e92..5994088 100644
--- a/modules/zotero/templates/logrotate.erb
+++ b/modules/zotero/templates/logrotate.erb
@@ -1,6 +1,6 @@
 # logrotate(8) config for zotero
 
-/var/log/zotero/* {
+<%= @log_dir -%>/zotero/* {
     daily
     copytruncate
     missingok
diff --git a/modules/zotero/templates/upstart.erb 
b/modules/zotero/templates/upstart.erb
index dd01f50..69d2f03 100644
--- a/modules/zotero/templates/upstart.erb
+++ b/modules/zotero/templates/upstart.erb
@@ -24,4 +24,4 @@
   -mn                                                                          
             \
   -v 180                                                                       
             \
   /srv/deployment/zotero/translation-server/translation-server/init.js         
             \
-  >> /var/log/zotero/zotero.log 2>&1
+  >> <%= @log_dir %>/zotero/zotero.log 2>&1

-- 
To view, visit https://gerrit.wikimedia.org/r/268847
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8527a4e72f7b8b8d9c188c755feb0d01dff5debb
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Mobrovac <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to