Giuseppe Lavagetto has submitted this change and it was merged.
Change subject: move text backend_random into "directors"
......................................................................
move text backend_random into "directors"
Change-Id: I9f856c54493cc9c72d50f80d449c8c9cba587a06
---
M modules/role/manifests/cache/text.pp
M templates/varnish/text-backend.inc.vcl.erb
M templates/varnish/text-frontend.inc.vcl.erb
3 files changed, 10 insertions(+), 35 deletions(-)
Approvals:
Giuseppe Lavagetto: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/role/manifests/cache/text.pp
b/modules/role/manifests/cache/text.pp
index 3c44af2..7c4cb9f 100644
--- a/modules/role/manifests/cache/text.pp
+++ b/modules/role/manifests/cache/text.pp
@@ -58,6 +58,11 @@
'type' => 'chash',
'backends' => $text_nodes['eqiad'],
},
+ 'backend_random' => {
+ 'dynamic' => 'yes',
+ 'type' => 'random',
+ 'backends' => $text_nodes['eqiad'],
+ },
},
}
@@ -125,6 +130,11 @@
'type' => 'chash',
'backends' => $site_text_nodes,
},
+ 'backend_random' => {
+ 'dynamic' => 'yes',
+ 'type' => 'random',
+ 'backends' => $site_text_nodes,
+ },
},
vcl_config => {
'retry503' => 1,
diff --git a/templates/varnish/text-backend.inc.vcl.erb
b/templates/varnish/text-backend.inc.vcl.erb
index f2bcac6..33c3a75 100644
--- a/templates/varnish/text-backend.inc.vcl.erb
+++ b/templates/varnish/text-backend.inc.vcl.erb
@@ -4,24 +4,6 @@
include "text-common.inc.vcl";
include "static-hash.inc.vcl";
-<% if @vcl_config.fetch("cluster_tier", "one") != "one" -%>
-director backend_random random {
-<%
- backends = @varnish_directors["backend"]['backends']
- if not backends.is_a?(Array)
- backends = [backends]
- end
- backends.each do |backend|
- name = /^[0-9\.]+$/.match(backend) ? "ipv4_" +
backend.gsub(".", "_") : backend.split(".")[0].gsub("-", "_")
--%>
- {
- .backend = <%= name %>;
- .weight = 10;
- }
-<% end -%>
-}
-<% end -%>
-
sub vcl_recv {
call vcl_recv_purge;
call restrict_access;
diff --git a/templates/varnish/text-frontend.inc.vcl.erb
b/templates/varnish/text-frontend.inc.vcl.erb
index cfae3b8..866c52b 100644
--- a/templates/varnish/text-frontend.inc.vcl.erb
+++ b/templates/varnish/text-frontend.inc.vcl.erb
@@ -24,23 +24,6 @@
// mobile-frontend.inc.vcl.erb for (m|zero).wikipedia.org and its
// subdomains.
-// A random director with the same backends as the default 'backend' (chash)
director
-director backend_random random {
-<%
- backends = @varnish_directors["backend"]['backends']
- if not backends.is_a?(Array)
- backends = [backends]
- end
- backends.each do |backend|
- name = /^[0-9\.]+$/.match(backend) ? "ipv4_" +
backend.gsub(".", "_") : backend.split(".")[0].gsub("-", "_")
--%>
- {
- .backend = <%= name %>;
- .weight = 10;
- }
-<% end -%>
-}
-
sub mobile_redirect {
if ((req.request == "GET" || req.request == "HEAD")
&& (req.http.User-Agent ~
"(?i)(mobi|240x240|240x320|320x320|alcatel|android|audiovox|bada|benq|blackberry|cdm-|compal-|docomo|ericsson|hiptop|htc[-_]|huawei|ipod|kddi-|kindle|meego|midp|mitsu|mmp\/|mot-|motor|ngm_|nintendo|opera.m|palm|panasonic|philips|phone|playstation|portalmmm|sagem-|samsung|sanyo|sec-|semc-browser|sendo|sharp|silk|softbank|symbian|teleca|up.browser|vodafone|webos)"
--
To view, visit https://gerrit.wikimedia.org/r/220645
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9f856c54493cc9c72d50f80d449c8c9cba587a06
Gerrit-PatchSet: 13
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits