BBlack has submitted this change and it was merged.

Change subject: cache_mobile decom: 2/2 Remove most cache config
......................................................................


cache_mobile decom: 2/2 Remove most cache config

After this we can manually stop various daemons on these hosts and
leave them idle (but still configured with "standard") for a few
days until they're re-purposed.

Bug: T109286
Change-Id: I51354c8abc76c480146f61210cb4f8f55e889a7d
---
M hieradata/common.yaml
D hieradata/common/cache/ipsec/mobile.yaml
D hieradata/common/cache/mobile.yaml
M hieradata/common/monitoring.yaml
M hieradata/labs.yaml
D hieradata/role/codfw/cache/mobile.yaml
D hieradata/role/common/cache/mobile.yaml
D hieradata/role/eqiad/cache/mobile.yaml
D hieradata/role/esams/cache/mobile.yaml
D hieradata/role/ulsfo/cache/mobile.yaml
M manifests/role/ipsec.pp
M manifests/site.pp
M modules/nrpe/templates/nrpe_local.cfg.erb
D modules/role/manifests/cache/mobile.pp
M modules/role/manifests/graphite/alerts/reqstats.pp
M modules/varnish/manifests/htcppurger.pp
M nodes/labs/staging.yaml
M templates/varnish/analytics.inc.vcl.erb
M templates/varnish/text-backend.inc.vcl.erb
M templates/varnish/text-frontend.inc.vcl.erb
20 files changed, 11 insertions(+), 367 deletions(-)

Approvals:
  BBlack: Verified; Looks good to me, approved



diff --git a/hieradata/common.yaml b/hieradata/common.yaml
index bff64e6..8a2b9b9 100644
--- a/hieradata/common.yaml
+++ b/hieradata/common.yaml
@@ -105,14 +105,6 @@
       eqiad: []
       codfw: []
       esams: []
-  cache_mobile:
-    name: "Mobile caches"
-    id: 28
-    sites:
-      eqiad: []
-      codfw: []
-      esams: []
-      ulsfo: []
   virt:
     name: "Virtualization cluster"
     id: 29
diff --git a/hieradata/common/cache/ipsec/mobile.yaml 
b/hieradata/common/cache/ipsec/mobile.yaml
deleted file mode 100644
index c1c3d13..0000000
--- a/hieradata/common/cache/ipsec/mobile.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-nodes:
-  codfw:
-    - 'cp2003.codfw.wmnet'
-    - 'cp2009.codfw.wmnet'
-    - 'cp2015.codfw.wmnet'
-    - 'cp2021.codfw.wmnet'
-  eqiad:
-    - 'cp1046.eqiad.wmnet'
-    - 'cp1047.eqiad.wmnet'
-    - 'cp1059.eqiad.wmnet'
-    - 'cp1060.eqiad.wmnet'
-  esams:
-    - 'cp3015.esams.wmnet'
-    - 'cp3016.esams.wmnet'
-    - 'cp3017.esams.wmnet'
-    - 'cp3018.esams.wmnet'
-  ulsfo:
-    - 'cp4011.ulsfo.wmnet'
-    - 'cp4012.ulsfo.wmnet'
-    - 'cp4019.ulsfo.wmnet'
-    - 'cp4020.ulsfo.wmnet'
diff --git a/hieradata/common/cache/mobile.yaml 
b/hieradata/common/cache/mobile.yaml
deleted file mode 100644
index c1c3d13..0000000
--- a/hieradata/common/cache/mobile.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-nodes:
-  codfw:
-    - 'cp2003.codfw.wmnet'
-    - 'cp2009.codfw.wmnet'
-    - 'cp2015.codfw.wmnet'
-    - 'cp2021.codfw.wmnet'
-  eqiad:
-    - 'cp1046.eqiad.wmnet'
-    - 'cp1047.eqiad.wmnet'
-    - 'cp1059.eqiad.wmnet'
-    - 'cp1060.eqiad.wmnet'
-  esams:
-    - 'cp3015.esams.wmnet'
-    - 'cp3016.esams.wmnet'
-    - 'cp3017.esams.wmnet'
-    - 'cp3018.esams.wmnet'
-  ulsfo:
-    - 'cp4011.ulsfo.wmnet'
-    - 'cp4012.ulsfo.wmnet'
-    - 'cp4019.ulsfo.wmnet'
-    - 'cp4020.ulsfo.wmnet'
diff --git a/hieradata/common/monitoring.yaml b/hieradata/common/monitoring.yaml
index b71827f..18b6626 100644
--- a/hieradata/common/monitoring.yaml
+++ b/hieradata/common/monitoring.yaml
@@ -28,14 +28,6 @@
     description: esams upload Varnish
   cache_upload_ulsfo:
     description: ulsfo upload Varnish
-  cache_mobile_codfw:
-    description: codfw mobile Varnish
-  cache_mobile_eqiad:
-    description: eqiad mobile Varnish
-  cache_mobile_esams:
-    description: esams mobile Varnish
-  cache_mobile_ulsfo:
-    description: ulsfo mobile Varnish
   cache_parsoid_codfw:
     description: Parsoid caches codfw
   cache_parsoid_eqiad:
diff --git a/hieradata/labs.yaml b/hieradata/labs.yaml
index f02b0f8..2e4c9a1 100644
--- a/hieradata/labs.yaml
+++ b/hieradata/labs.yaml
@@ -27,9 +27,6 @@
 cache::upload::nodes:
     eqiad:
       - '127.0.0.1'
-cache::mobile::nodes:
-    eqiad:
-      - '127.0.0.1'
 cache::parsoid::nodes:
     eqiad:
       - '127.0.0.1'
diff --git a/hieradata/role/codfw/cache/mobile.yaml 
b/hieradata/role/codfw/cache/mobile.yaml
deleted file mode 100644
index 32dfd54..0000000
--- a/hieradata/role/codfw/cache/mobile.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-debdeploy::grains:
-  debdeploy-cp-codfw-mobile:
-    value: standard
diff --git a/hieradata/role/common/cache/mobile.yaml 
b/hieradata/role/common/cache/mobile.yaml
deleted file mode 100644
index f35bc1e..0000000
--- a/hieradata/role/common/cache/mobile.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-cluster: cache_mobile
-admin::groups:
-  - perf-roots
diff --git a/hieradata/role/eqiad/cache/mobile.yaml 
b/hieradata/role/eqiad/cache/mobile.yaml
deleted file mode 100644
index aa324fa..0000000
--- a/hieradata/role/eqiad/cache/mobile.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-debdeploy::grains:
-  debdeploy-cp-eqiad-mobile:
-    value: standard
diff --git a/hieradata/role/esams/cache/mobile.yaml 
b/hieradata/role/esams/cache/mobile.yaml
deleted file mode 100644
index 32450e8..0000000
--- a/hieradata/role/esams/cache/mobile.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-debdeploy::grains:
-  debdeploy-cp-esams-mobile:
-    value: standard
diff --git a/hieradata/role/ulsfo/cache/mobile.yaml 
b/hieradata/role/ulsfo/cache/mobile.yaml
deleted file mode 100644
index 0f9bb82..0000000
--- a/hieradata/role/ulsfo/cache/mobile.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-debdeploy::grains:
-  debdeploy-cp-ulsfo-mobile:
-    value: standard
diff --git a/manifests/role/ipsec.pp b/manifests/role/ipsec.pp
index a5ff47d..46a778c 100644
--- a/manifests/role/ipsec.pp
+++ b/manifests/role/ipsec.pp
@@ -38,12 +38,10 @@
             $text    = hiera('cache::ipsec::text::nodes')
             $misc    = hiera('cache::ipsec::misc::nodes')
             $upload  = hiera('cache::ipsec::upload::nodes')
-            $mobile  = hiera('cache::ipsec::mobile::nodes')
             $targets = array_concat(
                 $text['esams'], $text['ulsfo'], $text['codfw'],
                 $misc['esams'], $misc['ulsfo'], $misc['codfw'],
-                $upload['esams'], $upload['ulsfo'], $upload['codfw'],
-                $mobile['esams'], $mobile['ulsfo'], $mobile['codfw']
+                $upload['esams'], $upload['ulsfo'], $upload['codfw']
             )
         }
     }
diff --git a/manifests/site.pp b/manifests/site.pp
index 966117d..9638b22 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -350,7 +350,7 @@
 
 node 'cp1046.eqiad.wmnet', 'cp1047.eqiad.wmnet', 'cp1059.eqiad.wmnet', 
'cp1060.eqiad.wmnet' {
     interface::add_ip6_mapped { 'main': }
-    role cache::mobile, ipsec
+    include standard # ex-mobile
 }
 
 node /^cp10(4[89]|5[01]|6[1-4]|7[1-4]|99)\.eqiad\.wmnet$/ {
@@ -380,7 +380,7 @@
 
 node /^cp20(0[39]|15|21)\.codfw\.wmnet$/ {
     interface::add_ip6_mapped { 'main': }
-    role cache::mobile, ipsec
+    include standard # ex-mobile
 }
 
 node /^cp20(06|1[28]|25)\.codfw\.wmnet$/ {
@@ -400,7 +400,7 @@
 
 node /^cp301[5678]\.esams\.wmnet$/ {
     interface::add_ip6_mapped { 'main': }
-    role cache::mobile, ipsec
+    include standard # ex-mobile
 }
 
 node /^cp30(19|2[0-2])\.esams\.wmnet$/ {
@@ -428,21 +428,18 @@
 }
 
 node /^cp40(0[5-7]|1[3-5])\.ulsfo\.wmnet$/ {
-
     interface::add_ip6_mapped { 'main': }
     role cache::upload, ipsec
 }
 
 node /^cp40(0[89]|1[0678])\.ulsfo\.wmnet$/ {
-
     interface::add_ip6_mapped { 'main': }
     role cache::text, ipsec
 }
 
 node /^cp40(1[129]|20)\.ulsfo\.wmnet$/ {
-
     interface::add_ip6_mapped { 'main': }
-    role cache::mobile, ipsec
+    include standard # ex-mobile
 }
 
 # T118763 (temporary in use)
diff --git a/modules/nrpe/templates/nrpe_local.cfg.erb 
b/modules/nrpe/templates/nrpe_local.cfg.erb
index 1530c6d..68b3137 100644
--- a/modules/nrpe/templates/nrpe_local.cfg.erb
+++ b/modules/nrpe/templates/nrpe_local.cfg.erb
@@ -12,8 +12,8 @@
 command[check_ram]=/usr/lib/nagios/plugins/check_ram.sh 20 5 b
 
 # process checks, we can't make this generic because we don't pass args via 
nrpe (security)
-<%# mobile & text caches run an extra varnishncsa for statsv eventlogging -%>
-<% if @cluster == "cache_mobile" or @cluster == "cache_text" -%>
+<%# text caches run an extra varnishncsa for statsv eventlogging -%>
+<% if @cluster == "cache_text" -%>
 command[check_varnishncsa]=/usr/lib/nagios/plugins/check_procs -w 3:3 -c 3:6 
-C varnishncsa
 <% else -%>
 command[check_varnishncsa]=/usr/lib/nagios/plugins/check_procs -w 2:2 -c 2:6 
-C varnishncsa
diff --git a/modules/role/manifests/cache/mobile.pp 
b/modules/role/manifests/cache/mobile.pp
deleted file mode 100644
index 269da43..0000000
--- a/modules/role/manifests/cache/mobile.pp
+++ /dev/null
@@ -1,235 +0,0 @@
-class role::cache::mobile {
-    system::role { 'role::cache::mobile':
-        description => 'mobile Varnish cache server',
-    }
-
-    class { 'varnish::htcppurger':
-        mc_addrs => [ '239.128.0.112' ],
-    }
-
-    include role::cache::2layer
-
-    class { 'lvs::realserver':
-        # Decommissioning cluster config: T109286
-        realserver_ips => []
-    }
-
-    $cluster_nodes = hiera('cache::mobile::nodes')
-    $site_cluster_nodes = $cluster_nodes[$::site]
-
-    # 1/8 of total mem
-    $memory_storage_size = ceiling(0.125 * $::memorysize_mb / 1024.0)
-
-    include role::cache::ssl::unified
-
-    require geoip
-    require geoip::dev # for VCL compilation using libGeoIP
-
-    $varnish_be_directors = {
-        'one' => {
-            'backend'          => {
-                'dynamic'  => 'no',
-                'type'     => 'random',
-                'backends' => 
$role::cache::configuration::backends[$::realm]['appservers'][$::mw_primary],
-            },
-            'api'              => {
-                'dynamic'  => 'no',
-                'type'     => 'random',
-                'backends' => 
$role::cache::configuration::backends[$::realm]['api'][$::mw_primary],
-            },
-            'rendering'        => {
-                'dynamic'  => 'no',
-                'type'     => 'random',
-                'backends' => 
$role::cache::configuration::backends[$::realm]['rendering'][$::mw_primary],
-            },
-            'security_audit'   => {
-                'dynamic'  => 'no',
-                'type'     => 'random',
-                'backends' => 
$role::cache::configuration::backends[$::realm]['security_audit'][$::mw_primary],
-            },
-            'appservers_debug' => {
-                'dynamic'  => 'no',
-                'type'     => 'random',
-                'backends' => 
$role::cache::configuration::backends[$::realm]['appservers_debug'][$::mw_primary],
-            },
-            'restbase_backend' => {
-                'dynamic'  => 'no',
-                'type'     => 'random',
-                'backends' => 
$role::cache::configuration::backends[$::realm]['restbase'][$::mw_primary],
-            },
-            'cxserver_backend' => { # LEGACY: should be removed eventually
-                'dynamic'  => 'no',
-                'type'     => 'random',
-                'backends' => 
$::role::cache::configuration::backends[$::realm]['cxserver'][$::mw_primary],
-            },
-            'citoid_backend'   => { # LEGACY: should be removed eventually
-                'dynamic'  => 'no',
-                'type'     => 'random',
-                'backends' => 
$::role::cache::configuration::backends[$::realm]['citoid'][$::mw_primary],
-            },
-        },
-        'two' => {
-            'backend'        => {
-                'dynamic'  => 'yes',
-                'type'     => 'chash',
-                'backends' => $cluster_nodes['eqiad'],
-            },
-            'backend_random' => {
-                'dynamic'  => 'yes',
-                'type'     => 'random',
-                'backends' => $cluster_nodes['eqiad'],
-                'service'  => 'varnish-be-rand',
-            },
-        },
-    }
-
-    if $::role::cache::configuration::has_ganglia {
-        include varnish::monitoring::ganglia::vhtcpd
-    }
-
-    $fe_t1_be_opts = array_concat(
-        $::role::cache::2layer::backend_scaled_weights,
-        [{
-            'port'                  => 3128,
-            'connect_timeout'       => '5s',
-            'first_byte_timeout'    => '185s',
-            'between_bytes_timeout' => '2s',
-            'max_connections'       => 100000,
-            'probe'                 => 'varnish',
-        }]
-    )
-
-    $fe_t2_be_opts = array_concat(
-        [{
-            'backend_match'         => '^cp[0-9]+\.eqiad.wmnet$',
-            'between_bytes_timeout' => '4s',
-            'max_connections'       => 1000,
-        }],
-        $fe_t1_be_opts
-    )
-
-    $fe_be_opts = $::site_tier ? {
-        'one'   => $fe_t1_be_opts,
-        default => $fe_t2_be_opts,
-    }
-
-    $common_vcl_config = {
-        'cache4xx'           => '1m',
-        'purge_host_regex'   => $::role::cache::base::purge_host_not_upload_re,
-        'static_host'        => $::role::cache::base::static_host,
-        'bits_domain'        => $::role::cache::base::bits_domain,
-        'top_domain'         => $::role::cache::base::top_domain,
-        'do_gzip'            => true,
-    }
-
-    $be_vcl_config = merge($common_vcl_config, {
-        'layer'              => 'backend',
-    })
-
-    $fe_vcl_config = merge($common_vcl_config, {
-        'layer'              => 'frontend',
-        'enable_geoiplookup' => true,
-        'https_redirects'    => true,
-    })
-
-    varnish::instance { 'mobile-backend':
-        name               => '',
-        vcl                => 'text-backend',
-        extra_vcl          => ['text-common'],
-        ports              => [ 3128 ],
-        admin_port         => 6083,
-        runtime_parameters => ['default_ttl=2592000'],
-        storage            => $::role::cache::2layer::persistent_storage_args,
-        directors          => $varnish_be_directors[$::site_tier],
-        vcl_config         => $be_vcl_config,
-        backend_options    => 
array_concat($::role::cache::2layer::backend_scaled_weights, [
-            {
-                'backend_match' => '^cp[0-9]+\.eqiad\.wmnet$',
-                'port'          => 3128,
-                'probe'         => 'varnish',
-            },
-            {
-                'backend_match'   => '^appservers-debug\.svc\.eqiad\.wmnet$',
-                'max_connections' => 20,
-            },
-            {
-                'backend_match'   => '^restbase\.svc\.|^deployment-restbase',
-                'port'            => 7231,
-                'max_connections' => 5000,
-            },
-            { # LEGACY: should be removed eventually
-                'backend_match'         => '^cxserver',
-                'port'                  => 8080,
-                'probe'                 => false,
-            },
-            { # LEGACY: should be removed eventually
-                'backend_match'         => '^citoid',
-                'port'                  => 1970,
-                'probe'                 => false,
-            },
-            {
-                'port'                  => 80,
-                'connect_timeout'       => '5s',
-                'first_byte_timeout'    => '180s',
-                'between_bytes_timeout' => '4s',
-                'max_connections'       => 1000,
-            },
-        ]),
-    }
-
-    varnish::instance { 'mobile-frontend':
-        name               => 'frontend',
-        vcl                => 'text-frontend',
-        extra_vcl          => ['text-common', 'zero'],
-        ports              => [ 80 ],
-        admin_port         => 6082,
-        runtime_parameters => ['default_ttl=2592000'],
-        storage            => "-s malloc,${memory_storage_size}G",
-        directors          => {
-            'backend' => {
-                'dynamic'  => 'yes',
-                'type'     => 'chash',
-                'backends' => $site_cluster_nodes,
-            },
-            'backend_random' => {
-                'dynamic'  => 'yes',
-                'type'     => 'random',
-                'backends' => $site_cluster_nodes,
-                'service'  => 'varnish-be-rand',
-            },
-        },
-        vcl_config         => $fe_vcl_config,
-        backend_options    => $fe_be_opts,
-    }
-
-    # varnishkafka statsv listens for special stats related requests
-    # and sends them to the 'statsv' topic in Kafka.
-    # A kafka consumer then consumes these and emits
-    # metrics.
-    class { '::role::cache::kafka::statsv':
-        varnish_name => 'frontend',
-    }
-
-    # varnishkafka eventlogging listens for eventlogging
-    # requests and logs them to the eventlogging-client-side
-    # topic.  EventLogging servers consume and process this
-    # topic into many JSON based kafka topics for further
-    # consumption.
-    class { '::role::cache::kafka::eventlogging':
-        varnish_name => 'frontend',
-    }
-
-    # ToDo: Remove production conditional once this works
-    # is verified to work in labs.
-    if $::realm == 'production' {
-        # Install a varnishkafka producer to send
-        # all varnish webrequest logs to Kafka.
-        class { 'role::cache::kafka::webrequest': topic => 'webrequest_mobile' 
}
-    }
-
-    # Parse varnishlogs for request statistics and send to statsd.
-    varnish::logging::reqstats { 'frontend':
-        metric_prefix => "varnish.${::site}.mobile.frontend.request",
-        statsd        => hiera('statsd'),
-    }
-}
diff --git a/modules/role/manifests/graphite/alerts/reqstats.pp 
b/modules/role/manifests/graphite/alerts/reqstats.pp
index 3086820..597d2fb 100644
--- a/modules/role/manifests/graphite/alerts/reqstats.pp
+++ b/modules/role/manifests/graphite/alerts/reqstats.pp
@@ -51,15 +51,6 @@
         nagios_critical => false,
     }
 
-    monitoring::graphite_threshold { 'reqstats-5xx-mobile':
-        description     => 'Mobile HTTP 5xx reqs/min',
-        metric          => 
'sumSeries(varnish.*.mobile.frontend.request.client.status.5xx.sum)',
-        warning         => $settings['warning'],
-        critical        => $settings['critical'],
-        from            => $settings['cron'],
-        nagios_critical => false,
-    }
-
     monitoring::graphite_threshold { 'reqstats-5xx-uploads':
         description     => 'Uploads HTTP 5xx reqs/min',
         metric          => 
'sumSeries(varnish.*.uploads.frontend.request.client.status.5xx.sum)',
diff --git a/modules/varnish/manifests/htcppurger.pp 
b/modules/varnish/manifests/htcppurger.pp
index e42ed23..d370183 100644
--- a/modules/varnish/manifests/htcppurger.pp
+++ b/modules/varnish/manifests/htcppurger.pp
@@ -13,7 +13,7 @@
 #   instances).
 #
 # === Multicast assignments:
-#   239.128.0.112 - text/mobile (legacy: all HTCP used this address)
+#   239.128.0.112 - text (legacy: all HTCP used this address)
 #   239.128.0.113 - upload
 #   239.128.0.114 - maps
 #
diff --git a/nodes/labs/staging.yaml b/nodes/labs/staging.yaml
index 51a2633..a5baf6d 100644
--- a/nodes/labs/staging.yaml
+++ b/nodes/labs/staging.yaml
@@ -12,8 +12,6 @@
   - role::db::redis
 .*-cache-text\d\d:
   - role::cache::text
-.*-cache-mobile\d\d:
-  - role::cache::mobile
 .*-cache-upload\d\d:
   - role::cache::upload
 .*-cache-parsoid\d\d:
diff --git a/templates/varnish/analytics.inc.vcl.erb 
b/templates/varnish/analytics.inc.vcl.erb
index bc7488f..f735a01 100644
--- a/templates/varnish/analytics.inc.vcl.erb
+++ b/templates/varnish/analytics.inc.vcl.erb
@@ -14,8 +14,7 @@
 /*****************************************************************************
  * This must be called *before* any vcl_recv cookie munging.  It more-properly
  * belongs in _deliver, but putting it here avoids all of the issues
- * surrounding consistent access to Cookie vs X-Orig-Cookie at vcl_deliver
- * time in the text/mobile cases.
+ * surrounding consistent access to Cookie vs X-Orig-Cookie in vcl_deliver
  * It does so at the cost of sending a pointless and unintended
  * "X-WMF-LastStamp: 01-Jan-2000" header to the application layer as well on
  * cache miss/bypass.
@@ -176,11 +175,6 @@
     // Add proxy=IORG X-Analytics tag if appropriate.
     // Although Via: Internet.org usually comes via proxying, it isn't 
guaranteed to come that way.
     // Nonetheless, as it is tagged with Via and the equipment is under 
Internet.org, we proxy tag.
-    // Note, Internet.org is believed to apply to all Wikimedia sites, so this 
code should run not
-    // just for (m|zero).wikipedia.org and subdomains. Hence the inclusion of 
this file by both
-    // mobile-frontend.inc.vcl.erb and text-frontend.inc.vcl.erb, as opposed 
to a one-off in
-    // zero.inc.vcl.erb alone. See the notes at the top of 
mobile-frontend.inc.vcl.erb and
-    // text-frontend.inc.vcl.erb for more context.
     if (req.http.Via ~ "(?i)Internet\.org") {
         set resp.http.X-Analytics = resp.http.X-Analytics + ";proxy=IORG";
     }
diff --git a/templates/varnish/text-backend.inc.vcl.erb 
b/templates/varnish/text-backend.inc.vcl.erb
index 8c018f7..8f62e38 100644
--- a/templates/varnish/text-backend.inc.vcl.erb
+++ b/templates/varnish/text-backend.inc.vcl.erb
@@ -51,9 +51,8 @@
                set bereq.url = regsub(req.url, "^/([^/]+)/load\.php(.*)?", 
"/w/load.php\2");
        }
 }
-<% end -%>
 
-<% if @site_tier == "one" && scope.function_hiera(["cluster"]) == "cache_text" 
-%>
+// Mobile hostname mangling for MediaWiki
 sub mobile_hostname_1be_mangle {
        if (req.http.X-Subdomain) {
                set bereq.http.host = req.http.x-dt-host;
@@ -68,8 +67,6 @@
                call bitscompat_1be_mangle;
                return (pass);
        }
-<% end -%>
-<% if @site_tier == "one" && scope.function_hiera(["cluster"]) == "cache_text" 
-%>
        call mobile_hostname_1be_mangle;
 <% end -%>
        call restore_cookie;
@@ -82,8 +79,6 @@
                call bitscompat_1be_mangle;
                return (fetch);
        }
-<% end -%>
-<% if @site_tier == "one" && scope.function_hiera(["cluster"]) == "cache_text" 
-%>
        call mobile_hostname_1be_mangle;
 <% end -%>
        call restore_cookie;
diff --git a/templates/varnish/text-frontend.inc.vcl.erb 
b/templates/varnish/text-frontend.inc.vcl.erb
index 71a8d71..4c24eab 100644
--- a/templates/varnish/text-frontend.inc.vcl.erb
+++ b/templates/varnish/text-frontend.inc.vcl.erb
@@ -16,11 +16,6 @@
 // Internet.org endpoint with an unpredictable Internet-facing IP
 // address) in X-Forwarded-For, even if it's the only value, as in
 // the example of traffic sourced directly by satellite or something.
-// IMPORTANT NOTE: other proxy tagging isn't in place for the domains
-// scoped by this text-frontend.inc.vcl.erb file, as that's currently
-// only inside of zero.inc.vcl.erb, which is invoked by
-// mobile-frontend.inc.vcl.erb for (m|zero).wikipedia.org and its
-// subdomains.
 
 sub mobile_redirect {
        if (!req.http.X-Subdomain && (req.request == "GET" || req.request == 
"HEAD")
@@ -169,16 +164,6 @@
                        set req.http.X-Subdomain = "M";
                }
 
-<% if scope.function_hiera(["cluster"]) == "cache_mobile" -%>
-               // mobile-cluster-only: prevent desktop/text hostnames from
-               // being used here, or they'll pollute the cache for mobile
-               // users.  This will never happen via our own DNS, but a user
-               // could set the request hostname manually of course...
-               if (!req.http.X-Subdomain && req.request != "PURGE") {
-                       error 418 "I'm a teapot";
-               }
-<% end -%>
-
                // mobile-subdomains-only for tag-carrier and Host-rewrite
                if (req.http.X-Subdomain) {
                        // Only do tag_carrier logic on first start, and only 
for (m|zero).wp
@@ -199,10 +184,7 @@
                                // Replace <language>.(m|zero).<project>.org by 
<language>.<project>.org
                                set req.http.x-dt-host = regsub(req.http.host, 
"^([a-zA-Z0-9-]+)\.(m|zero)\.", "\1.");
                        }
-<% if scope.function_hiera(["cluster"]) == "cache_mobile" -%>
-                       // legacy cache_mobile actually resets the real Host: 
header value here, cache_text does not...
-                       set req.http.host = req.http.x-dt-host;
-<% end -%>
+
                        if (req.url ~ "^/api/rest_v1/") {
                                // for Restbase, there is no difference in 
desktop-vs-mobile hostnames,
                                // so rewrite mobile hostnames to desktop 
hostnames for singular caching

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I51354c8abc76c480146f61210cb4f8f55e889a7d
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack <[email protected]>
Gerrit-Reviewer: BBlack <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to