Chad has uploaded a new change for review.

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

Change subject: Gerrit: Clean up cron job definitions
......................................................................

Gerrit: Clean up cron job definitions

* Log rotation cron goes to jetty manifest, that's what needs it
* Remaining crons only matter if we're the master, so move them into
  that stanza so they're not on slaves

Change-Id: I526b8325abf6aaf878b8a95edff7e71e57b5a673
---
M modules/gerrit/manifests/crons.pp
M modules/gerrit/manifests/init.pp
M modules/gerrit/manifests/jetty.pp
3 files changed, 12 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/60/315960/1

diff --git a/modules/gerrit/manifests/crons.pp 
b/modules/gerrit/manifests/crons.pp
index 10a7cd8..706c3af 100644
--- a/modules/gerrit/manifests/crons.pp
+++ b/modules/gerrit/manifests/crons.pp
@@ -22,12 +22,4 @@
         hour    => 1,
         require => File['/var/www/reviewer-counts.json'],
     }
-
-    cron { 'clear_gerrit_logs':
-    # Gerrit rotates their own logs, but doesn't clean them out
-    # Delete logs older than a week
-        command => 'find /var/lib/gerrit2/review_site/logs/ -name "*.gz" 
-mtime +7 -delete',
-        user    => 'root',
-        hour    => 1
-    }
 }
diff --git a/modules/gerrit/manifests/init.pp b/modules/gerrit/manifests/init.pp
index dcfef68..3ef7baf 100644
--- a/modules/gerrit/manifests/init.pp
+++ b/modules/gerrit/manifests/init.pp
@@ -14,9 +14,9 @@
         class { 'gerrit::proxy':
             require => Class['gerrit::jetty'],
         }
-    }
 
-    class { 'gerrit::crons':
-        require => Class['gerrit::jetty'],
+        class { 'gerrit::crons':
+            require => Class['gerrit::jetty'],
+        }
     }
 }
diff --git a/modules/gerrit/manifests/jetty.pp 
b/modules/gerrit/manifests/jetty.pp
index 9f35328..f1ba464 100644
--- a/modules/gerrit/manifests/jetty.pp
+++ b/modules/gerrit/manifests/jetty.pp
@@ -172,4 +172,13 @@
         description  => 'gerrit process',
         nrpe_command => "/usr/lib/nagios/plugins/check_procs -w 1:1 -c 1:1 
--ereg-argument-array '^GerritCodeReview .*-jar 
/var/lib/gerrit2/review_site/bin/gerrit.war'"
     }
+
+    cron { 'clear_gerrit_logs':
+    # Gerrit rotates their own logs, but doesn't clean them out
+    # Delete logs older than a week
+        command => 'find /var/lib/gerrit2/review_site/logs/ -name "*.gz" 
-mtime +7 -delete',
+        user    => 'root',
+        hour    => 1,
+        require => Exec['install_gerrit_jetty'],
+    }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I526b8325abf6aaf878b8a95edff7e71e57b5a673
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Chad <ch...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to