Ema has submitted this change and it was merged.

Change subject: cache_: enable varnish-be weekly cron restart for all clusters
......................................................................


cache_: enable varnish-be weekly cron restart for all clusters

Install /etc/cron.d/varnish-backend-restart in r::c::base. All clusters
need it. Use hiera('cache::cluster') to get the proper list of nodes
according to the cluster name, and for cron_splay().

Bug: T149784
Change-Id: Ib0f7d25a2606d5bfefff57f4d53b2bf8f64eaacf
---
M modules/role/manifests/cache/base.pp
M modules/role/manifests/cache/upload.pp
2 files changed, 18 insertions(+), 18 deletions(-)

Approvals:
  Ema: Verified; Looks good to me, approved
  BBlack: Looks good to me, but someone else must approve



diff --git a/modules/role/manifests/cache/base.pp 
b/modules/role/manifests/cache/base.pp
index a0820ad..c6f127f 100644
--- a/modules/role/manifests/cache/base.pp
+++ b/modules/role/manifests/cache/base.pp
@@ -54,6 +54,24 @@
         }
     }
 
+    # XXX: temporary, we need this to mitigate T145661
+    if $::realm == 'production' {
+        $hnodes = hiera("cache::${cache_cluster}::nodes")
+        $all_nodes = array_concat($hnodes['eqiad'], $hnodes['esams'], 
$hnodes['ulsfo'], $hnodes['codfw'])
+        $times = cron_splay($all_nodes, 'weekly', 
"${cache_cluster}-backend-restarts")
+        $be_restart_h = $times['hour']
+        $be_restart_m = $times['minute']
+        $be_restart_d = $times['weekday']
+
+        file { '/etc/cron.d/varnish-backend-restart':
+            mode    => '0444',
+            owner   => 'root',
+            group   => 'root',
+            content => template('varnish/varnish-backend-restart.cron.erb'),
+            require => File['/usr/local/sbin/varnish-backend-restart'],
+        }
+    }
+
     ###########################################################################
     # Analytics/Logging stuff
     ###########################################################################
diff --git a/modules/role/manifests/cache/upload.pp 
b/modules/role/manifests/cache/upload.pp
index 474d1ec..3b77876 100644
--- a/modules/role/manifests/cache/upload.pp
+++ b/modules/role/manifests/cache/upload.pp
@@ -124,22 +124,4 @@
     ::varnish::logging::media { 'media':
         statsd_server => hiera('statsd'),
     }
-
-    # XXX: temporary, we need this to mitigate T145661
-    if $::realm == 'production' {
-        $hnodes = hiera('cache::upload::nodes')
-        $all_nodes = array_concat($hnodes['eqiad'], $hnodes['esams'], 
$hnodes['ulsfo'], $hnodes['codfw'])
-        $times = cron_splay($all_nodes, 'weekly', 'upload-backend-restarts')
-        $be_restart_h = $times['hour']
-        $be_restart_m = $times['minute']
-        $be_restart_d = $times['weekday']
-
-        file { '/etc/cron.d/varnish-backend-restart':
-            mode    => '0444',
-            owner   => 'root',
-            group   => 'root',
-            content => template('varnish/varnish-backend-restart.cron.erb'),
-            require => File['/usr/local/sbin/varnish-backend-restart'],
-        }
-    }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib0f7d25a2606d5bfefff57f4d53b2bf8f64eaacf
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ema <e...@wikimedia.org>
Gerrit-Reviewer: BBlack <bbl...@wikimedia.org>
Gerrit-Reviewer: Ema <e...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to