BBlack has submitted this change and it was merged.

Change subject: Switch inheritance to include; refactor storage conf
......................................................................


Switch inheritance to include; refactor storage conf

Change-Id: I23f4cccd2015b35246e7e7cfd93ee979be2e6a3c
---
M modules/role/manifests/cache/1layer.pp
M modules/role/manifests/cache/2layer.pp
M modules/role/manifests/cache/base.pp
M modules/role/manifests/cache/bits.pp
M modules/role/manifests/cache/misc.pp
M modules/role/manifests/cache/mobile.pp
M modules/role/manifests/cache/parsoid.pp
M modules/role/manifests/cache/text.pp
M modules/role/manifests/cache/upload.pp
9 files changed, 123 insertions(+), 148 deletions(-)

Approvals:
  Giuseppe Lavagetto: Looks good to me, but someone else must approve
  BBlack: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/role/manifests/cache/1layer.pp 
b/modules/role/manifests/cache/1layer.pp
index ee7c26c..df39350 100644
--- a/modules/role/manifests/cache/1layer.pp
+++ b/modules/role/manifests/cache/1layer.pp
@@ -1,7 +1,6 @@
-# Ancestor class for common resources of 1-layer clusters
-class role::cache::1layer inherits role::cache::base {
-    # Any changes here will affect all descendent Varnish clusters
-    # unless they're overridden!
+# To be included by all concrete 1layer cache roles
+class role::cache::1layer {
+    include role::cache::base
 
     if $::role::cache::configuration::has_ganglia {
         include varnish::monitoring::ganglia
diff --git a/modules/role/manifests/cache/2layer.pp 
b/modules/role/manifests/cache/2layer.pp
index 7ea9b89..61b81e4 100644
--- a/modules/role/manifests/cache/2layer.pp
+++ b/modules/role/manifests/cache/2layer.pp
@@ -1,7 +1,15 @@
-# Ancestor class for common resources of 2-layer clusters
-class role::cache::2layer inherits role::cache::base {
-    # Any changes here will affect all descendent Varnish clusters
-    # unless they're overridden!
+# To be included by all concrete 2layer cache roles
+class role::cache::2layer {
+    include role::cache::base
+
+    # Ganglia monitoring
+    if $::role::cache::configuration::has_ganglia {
+        class { 'varnish::monitoring::ganglia':
+            varnish_instances => [ '', 'frontend' ],
+        }
+    }
+
+    # everything from here down is related to backend storage/weight config
 
     # This is now only used for director retries math, not for setting the
     # actual backend weights.  The math itself has been left alone, as
@@ -12,7 +20,7 @@
     $backend_weight_avg = 100
 
     if $::realm == 'production' {
-        $storage_size_main = $::hostname ? {
+        $storage_size = $::hostname ? {
             /^cp10(08|4[34])$/      => 117, # Intel X-25M 160G
             /^cp30(0[3-9]|1[0-4])$/ => 460, # Intel M320 600G via H710
             /^cp301[5-8]$/          => 225, # Intel M320 300G via H710
@@ -51,14 +59,40 @@
     }
     else {
         # for upload on jessie, bigobj is main/6, so 6 is functional minimum 
here.
-        $storage_size_main = 6
+        $storage_size = 6
         $backend_scaled_weights = [ { backend_match => '.', weight => 100 } ]
     }
 
-    # Ganglia monitoring
-    if $::role::cache::configuration::has_ganglia{
-        class { 'varnish::monitoring::ganglia':
-            varnish_instances => [ '', 'frontend' ],
-        }
+    # mma: mmap addrseses for fixed persistent storage on x86_64 Linux:
+    #  This scheme fits 4x fixed memory mappings of up to 4TB each
+    #  into the range 0x500000000000 - 0x5FFFFFFFFFFF, which on
+    #  x86_64 Linux is in the middle of the user address space and thus
+    #  unlikely to ever be used by normal, auto-addressed allocations,
+    #  as those grow in from the edges (typically from the top, but
+    #  possibly from the bottom depending).  Regardless of which
+    #  direction heap grows from, there's 32TB or more for normal
+    #  allocations to chew through before they reach our fixed range.
+    $mma = [
+        '0x500000000000',
+        '0x540000000000',
+        '0x580000000000',
+        '0x5C0000000000',
+    ]
+
+    # Everything else relies on length-two arrays here!
+    $storage_parts = $::realm ? {
+        production => [ 'sda3', 'sdb3' ],
+        labs => [ 'vdb', 'vdb' ],
     }
+
+    $filesystems = unique($storage_parts)
+    varnish::setup_filesystem { $filesystems: }
+    Varnish::Setup_filesystem <| |> -> Varnish::Instance <| |>
+
+    # This is the "normal" persistent storage varnish args, for consuming all 
available space
+    # (upload uses something more complex than this based on our storage vars 
above as well!)
+    $persistent_storage_args = join([
+        "-s 
main1=persistent,/srv/${storage_parts[0]}/varnish.main1,${storage_size}G,${mma[0]}",
+        "-s 
main2=persistent,/srv/${storage_parts[1]}/varnish.main2,${storage_size}G,${mma[1]}",
+    ], ' ')
 }
diff --git a/modules/role/manifests/cache/base.pp 
b/modules/role/manifests/cache/base.pp
index 9d1cf98..5999293 100644
--- a/modules/role/manifests/cache/base.pp
+++ b/modules/role/manifests/cache/base.pp
@@ -1,4 +1,3 @@
-# Ancestor class for all Varnish clusters
 class role::cache::base {
     include lvs::configuration
     include role::cache::configuration
@@ -19,25 +18,6 @@
         $default_backend = $::mw_primary
     }
     $wikimedia_networks = flatten([$network::constants::all_networks, 
'127.0.0.0/8', '::1/128'])
-
-    $storage_partitions = $::realm ? {
-        'production' => ['sda3', 'sdb3'],
-        'labs'       => ['vdb'],
-    }
-
-    # mma: mmap addrseses for fixed persistent storage on x86_64 Linux:
-    #  This scheme fits 4x fixed memory mappings of up to 4TB each
-    #  into the range 0x500000000000 - 0x5FFFFFFFFFFF, which on
-    #  x86_64 Linux is in the middle of the user address space and thus
-    #  unlikely to ever be used by normal, auto-addressed allocations,
-    #  as those grow in from the edges (typically from the top, but
-    #  possibly from the bottom depending).  Regardless of which
-    #  direction heap grows from, there's 32TB or more for normal
-    #  allocations to chew through before they reach our fixed range.
-    $mma0 = 0x500000000000
-    $mma1 = 0x540000000000
-    $mma2 = 0x580000000000
-    $mma3 = 0x5C0000000000
 
     # These regexes are for optimization of PURGE traffic by having
     #   non-upload sites ignore upload purges and having upload
diff --git a/modules/role/manifests/cache/bits.pp 
b/modules/role/manifests/cache/bits.pp
index 84abef7..3de0894 100644
--- a/modules/role/manifests/cache/bits.pp
+++ b/modules/role/manifests/cache/bits.pp
@@ -1,4 +1,5 @@
-class role::cache::bits inherits role::cache::1layer {
+class role::cache::bits {
+    include role::cache::1layer
 
     if $::realm == 'production' {
         include role::cache::ssl::sni
@@ -14,7 +15,6 @@
         'do_gzip'            => true,
     }
 
-    $default_backend = 'backend'
     $varnish_directors = {
         1 => {
             'backend' => 
$::role::cache::configuration::backends[$::realm]['bits_appservers'][$::mw_primary],
@@ -25,7 +25,7 @@
         }
     }
 
-    $probe = $cluster_tier ? {
+    $probe = $::role::cache::base::cluster_tier ? {
         1       => 'bits',
         default => 'varnish',
     }
@@ -65,16 +65,16 @@
         port            => 80,
         admin_port      => 6082,
         storage         => "-s malloc,${memory_storage_size}G",
-        directors       => $varnish_directors[$cluster_tier],
+        directors       => 
$varnish_directors[$::role::cache::base::cluster_tier],
         director_type   => 'random',
         vcl_config      => {
-            'default_backend' => $default_backend,
+            'default_backend' => 'backend',
             'retry503'        => 4,
             'retry5xx'        => 1,
             'cache4xx'        => '1m',
-            'cluster_tier'    => $cluster_tier,
+            'cluster_tier'    => $::role::cache::base::cluster_tier,
             'layer'           => 'frontend',
-            'ssl_proxies'     => $wikimedia_networks,
+            'ssl_proxies'     => $::role::cache::base::wikimedia_networks,
         },
         backend_options => {
             'port'                  => 80,
diff --git a/modules/role/manifests/cache/misc.pp 
b/modules/role/manifests/cache/misc.pp
index afa738b..a555eb3 100644
--- a/modules/role/manifests/cache/misc.pp
+++ b/modules/role/manifests/cache/misc.pp
@@ -1,4 +1,5 @@
-class role::cache::misc inherits role::cache::1layer {
+class role::cache::misc {
+    include role::cache::1layer
 
     class { 'lvs::realserver':
         realserver_ips => 
$lvs::configuration::lvs_service_ips[$::realm]['misc_web'][$::site],
@@ -25,7 +26,7 @@
             'retry5xx'        => 1,
             'cache4xx'        => '1m',
             'layer'           => 'frontend',
-            'ssl_proxies'     => $wikimedia_networks,
+            'ssl_proxies'     => $::role::cache::base::wikimedia_networks,
             'default_backend' => 'antimony',    # FIXME
             'allowed_methods' => '^(GET|HEAD|POST|PURGE|PUT)$',
         },
diff --git a/modules/role/manifests/cache/mobile.pp 
b/modules/role/manifests/cache/mobile.pp
index 6452aed..8930b73 100644
--- a/modules/role/manifests/cache/mobile.pp
+++ b/modules/role/manifests/cache/mobile.pp
@@ -1,4 +1,5 @@
-class role::cache::mobile inherits role::cache::2layer {
+class role::cache::mobile {
+    include role::cache::2layer
 
     $mobile_nodes = hiera('cache::mobile::nodes')
     $site_mobile_nodes = $mobile_nodes[$::site]
@@ -39,14 +40,10 @@
         }
     }
 
-    if $cluster_tier == 1 {
+    if $::role::cache::base::cluster_tier == 1 {
         $director_retries = 2
     } else {
-        $director_retries = $backend_weight_avg * 4
-    }
-
-    varnish::setup_filesystem{ $storage_partitions:
-        before => Varnish::Instance['mobile-backend']
+        $director_retries = $::role::cache::2layer::backend_weight_avg * 4
     }
 
     class { 'varnish::htcppurger':
@@ -83,17 +80,12 @@
         auth_src => 'puppet:///private/misc/zerofetcher.auth',
     }
 
-    $storage_conf = $::realm ? {
-        'production' => "-s 
main1=persistent,/srv/sda3/varnish.main1,${storage_size_main}G,$mma0 -s 
main2=persistent,/srv/sdb3/varnish.main2,${storage_size_main}G,$mma1",
-        'labs'      => "-s 
main1=persistent,/srv/vdb/varnish.main1,${storage_size_main}G,$mma0 -s 
main2=persistent,/srv/vdb/varnish.main2,${storage_size_main}G,$mma1",
-    }
-
     $runtime_param = $::site ? {
         # 'esams' => ["prefer_ipv6=on"],
         default  => [],
     }
 
-    $director_type_cluster = $cluster_tier ? {
+    $director_type_cluster = $::role::cache::base::cluster_tier ? {
         1       => 'random',
         default => 'chash',
     }
@@ -103,23 +95,23 @@
         vcl                => 'mobile-backend',
         port               => 3128,
         admin_port         => 6083,
-        storage            => $storage_conf,
+        storage            => $::role::cache::2layer::persistent_storage_args,
         runtime_parameters => $runtime_param,
-        directors          => $varnish_be_directors[$cluster_tier],
+        directors          => 
$varnish_be_directors[$::role::cache::base::cluster_tier],
         director_type      => $director_type_cluster,
         director_options   => {
             'retries' => $director_retries,
         },
         vcl_config         => {
-            'default_backend'  => $default_backend,
+            'default_backend'  => $::role::cache::base::default_backend,
             'retry503'         => 4,
             'retry5xx'         => 1,
-            'purge_host_regex' => $purge_host_not_upload_re,
-            'cluster_tier'     => $cluster_tier,
+            'purge_host_regex' => 
$::role::cache::base::purge_host_not_upload_re,
+            'cluster_tier'     => $::role::cache::base::cluster_tier,
             'layer'            => 'backend',
-            'ssl_proxies'      => $wikimedia_networks,
+            'ssl_proxies'      => $::role::cache::base::wikimedia_networks,
         },
-        backend_options    => array_concat($backend_scaled_weights, [
+        backend_options    => 
array_concat($::role::cache::2layer::backend_scaled_weights, [
             {
                 'backend_match'   => '^mw1017\.eqiad\.wmnet$',
                 'max_connections' => 20,
@@ -138,7 +130,7 @@
             },
         ]),
         cluster_options    => $cluster_options,
-        wikimedia_networks => $wikimedia_networks,
+        wikimedia_networks => $::role::cache::base::wikimedia_networks,
     }
 
     varnish::instance { 'mobile-frontend':
@@ -152,17 +144,17 @@
             'backend' => $site_mobile_nodes,
         },
         director_options => {
-            'retries' => $backend_weight_avg * size($site_mobile_nodes),
+            'retries' => $::role::cache::2layer::backend_weight_avg * 
size($site_mobile_nodes),
         },
         director_type    => 'chash',
         vcl_config       => {
             'retry5xx'         => 0,
-            'purge_host_regex' => $purge_host_not_upload_re,
-            'cluster_tier'     => $cluster_tier,
+            'purge_host_regex' => 
$::role::cache::base::purge_host_not_upload_re,
+            'cluster_tier'     => $::role::cache::base::cluster_tier,
             'layer'            => 'frontend',
-            'ssl_proxies'      => $wikimedia_networks,
+            'ssl_proxies'      => $::role::cache::base::wikimedia_networks,
         },
-        backend_options  => array_concat($backend_scaled_weights, [
+        backend_options  => 
array_concat($::role::cache::2layer::backend_scaled_weights, [
             {
                 'port'                  => 3128,
                 'connect_timeout'       => '5s',
diff --git a/modules/role/manifests/cache/parsoid.pp 
b/modules/role/manifests/cache/parsoid.pp
index 6f5da53..bd64ed3 100644
--- a/modules/role/manifests/cache/parsoid.pp
+++ b/modules/role/manifests/cache/parsoid.pp
@@ -1,4 +1,5 @@
-class role::cache::parsoid inherits role::cache::2layer {
+class role::cache::parsoid {
+    include role::cache::2layer
 
     $parsoid_nodes = hiera('cache::parsoid::nodes')
     $site_parsoid_nodes = $parsoid_nodes[$::site]
@@ -17,21 +18,8 @@
     include standard
     include nrpe
 
-    $storage_partitions = $::realm ? {
-        'production' => ['sda3', 'sdb3'],
-        'labs'       => ['vdb'],
-    }
-    varnish::setup_filesystem{ $storage_partitions:
-        before => Varnish::Instance['parsoid-backend'],
-    }
-
     # No HTCP daemon for Parsoid; the MediaWiki extension sends PURGE requests 
itself
     #class { "varnish::htcppurger": varnish_instances => [ "localhost:80", 
"localhost:3128" ] }
-
-    $storage_conf = $::realm ? {
-        'production' => "-s 
main1=persistent,/srv/sda3/varnish.main1,${storage_size_main}G,$mma0 -s 
main2=persistent,/srv/sdb3/varnish.main2,${storage_size_main}G,$mma1",
-        'labs' => "-s 
main1=persistent,/srv/vdb/varnish.main1,${storage_size_main}G,$mma0 -s 
main2=persistent,/srv/vdb/varnish.main2,${storage_size_main}G,$mma1",
-    }
 
     varnish::instance { 'parsoid-backend':
         name             => '',
@@ -39,7 +27,7 @@
         extra_vcl        => ['parsoid-common'],
         port             => 3128,
         admin_port       => 6083,
-        storage          => $storage_conf,
+        storage          => $::role::cache::2layer::persistent_storage_args,
         directors        => {
             'backend'          => 
$::role::cache::configuration::backends[$::realm]['parsoid'][$::mw_primary],
             'cxserver_backend' => 
$::role::cache::configuration::backends[$::realm]['cxserver'][$::site],
@@ -52,7 +40,7 @@
         vcl_config       => {
             'retry503'    => 4,
             'retry5xx'    => 1,
-            'ssl_proxies' => $wikimedia_networks,
+            'ssl_proxies' => $::role::cache::base::wikimedia_networks,
         },
         backend_options  => [
             {
@@ -94,13 +82,13 @@
         },
         director_type   => 'chash',
         director_options => {
-            'retries' => $backend_weight_avg * size($site_parsoid_nodes),
+            'retries' => $::role::cache::2layer::backend_weight_avg * 
size($site_parsoid_nodes),
         },
         vcl_config      => {
             'retry5xx'    => 0,
-            'ssl_proxies' => $wikimedia_networks,
+            'ssl_proxies' => $::role::cache::base::wikimedia_networks,
         },
-        backend_options => array_concat($backend_scaled_weights, [
+        backend_options => 
array_concat($::role::cache::2layer::backend_scaled_weights, [
             {
                 'backend_match'         => '^cxserver',
                 'port'                  => 8080,
diff --git a/modules/role/manifests/cache/text.pp 
b/modules/role/manifests/cache/text.pp
index ec9026a..947f744 100644
--- a/modules/role/manifests/cache/text.pp
+++ b/modules/role/manifests/cache/text.pp
@@ -1,4 +1,5 @@
-class role::cache::text inherits role::cache::2layer {
+class role::cache::text {
+    include role::cache::2layer
 
     $text_nodes = hiera('cache::text::nodes')
     $site_text_nodes = $text_nodes[$::site]
@@ -42,10 +43,6 @@
 
     #class { "varnish::packages": version => "3.0.3plus~rc1-wm13" }
 
-    varnish::setup_filesystem{ $storage_partitions:
-        before => Varnish::Instance['text-backend']
-    }
-
     class { 'varnish::htcppurger':
         varnish_instances => [ '127.0.0.1:80', '127.0.0.1:3128' ],
     }
@@ -59,12 +56,7 @@
         default => ['default_ttl=2592000'],
     }
 
-    $storage_conf = $::realm ? {
-        'production' => "-s 
main1=persistent,/srv/sda3/varnish.main1,${storage_size_main}G,$mma0 -s 
main2=persistent,/srv/sdb3/varnish.main2,${storage_size_main}G,$mma1",
-        'labs'  => "-s 
main1=persistent,/srv/vdb/varnish.main1,${storage_size_main}G,$mma0 -s 
main2=persistent,/srv/vdb/varnish.main2,${storage_size_main}G,$mma1",
-    }
-
-    $director_type_cluster = $cluster_tier ? {
+    $director_type_cluster = $::role::cache::base::cluster_tier ? {
         1       => 'random',
         default => 'chash',
     }
@@ -76,20 +68,20 @@
         port               => 3128,
         admin_port         => 6083,
         runtime_parameters => $runtime_params,
-        storage            => $storage_conf,
-        directors          => $varnish_be_directors[$cluster_tier],
+        storage            => $::role::cache::2layer::persistent_storage_args,
+        directors          => 
$varnish_be_directors[$::role::cache::base::cluster_tier],
         director_type      => $director_type_cluster,
         vcl_config         => {
-            'default_backend'  => $default_backend,
+            'default_backend'  => $::role::cache::base::default_backend,
             'retry503'         => 1,
             'retry5xx'         => 0,
             'cache4xx'         => '1m',
-            'purge_host_regex' => $purge_host_not_upload_re,
-            'cluster_tier'     => $cluster_tier,
+            'purge_host_regex' => 
$::role::cache::base::purge_host_not_upload_re,
+            'cluster_tier'     => $::role::cache::base::cluster_tier,
             'layer'            => 'backend',
-            'ssl_proxies'      => $wikimedia_networks,
+            'ssl_proxies'      => $::role::cache::base::wikimedia_networks,
         },
-        backend_options    => array_concat($backend_scaled_weights, [
+        backend_options    => 
array_concat($::role::cache::2layer::backend_scaled_weights, [
             {
                 'backend_match' => '^cp[0-9]+\.eqiad\.wmnet$',
                 'port'          => 3128,
@@ -107,7 +99,7 @@
                 'max_connections'       => 1000,
             },
         ]),
-        wikimedia_networks => $wikimedia_networks,
+        wikimedia_networks => $::role::cache::base::wikimedia_networks,
     }
 
     varnish::instance { 'text-frontend':
@@ -125,12 +117,12 @@
             'retry503'         => 1,
             'retry5xx'         => 0,
             'cache4xx'         => '1m',
-            'purge_host_regex' => $purge_host_not_upload_re,
-            'cluster_tier'     => $cluster_tier,
+            'purge_host_regex' => 
$::role::cache::base::purge_host_not_upload_re,
+            'cluster_tier'     => $::role::cache::base::cluster_tier,
             'layer'            => 'frontend',
-            'ssl_proxies'      => $wikimedia_networks,
+            'ssl_proxies'      => $::role::cache::base::wikimedia_networks,
         },
-        backend_options    => array_concat($backend_scaled_weights, [
+        backend_options    => 
array_concat($::role::cache::2layer::backend_scaled_weights, [
             {
                 'port'                  => 3128,
                 'connect_timeout'       => '5s',
diff --git a/modules/role/manifests/cache/upload.pp 
b/modules/role/manifests/cache/upload.pp
index b3f4bdd..180f264 100644
--- a/modules/role/manifests/cache/upload.pp
+++ b/modules/role/manifests/cache/upload.pp
@@ -1,4 +1,5 @@
-class role::cache::upload inherits role::cache::2layer {
+class role::cache::upload {
+    include role::cache::2layer
 
     $upload_nodes = hiera('cache::upload::nodes')
     $site_upload_nodes = $upload_nodes[$::site]
@@ -32,27 +33,14 @@
         }
     }
 
-    $default_backend = $cluster_tier ? {
-        1       => 'backend',
-        default => 'eqiad',
-    }
-
-    if $cluster_tier == 1 {
+    if $::role::cache::base::cluster_tier == 1 {
         $director_retries = 2
     } else {
-        $director_retries = $backend_weight_avg * 4
+        $director_retries = $::role::cache::2layer::backend_weight_avg * 4
     }
 
     include standard
     include nrpe
-
-    $storage_partitions = $::realm ? {
-        'production' => ['sda3', 'sdb3'],
-        'labs' => ['vdb']
-    }
-    varnish::setup_filesystem{ $storage_partitions:
-        before => Varnish::Instance['upload-backend'],
-    }
 
     class { 'varnish::htcppurger':
         varnish_instances => [ '127.0.0.1:80', '127.0.0.1:3128' ],
@@ -86,15 +74,16 @@
         default  => ['default_ttl=2592000'],
     }
 
+    $storage_size_bigobj = floor($::role::cache::2layer::storage_size / 6)
+    $storage_size_up = $::role::cache::2layer::storage_size - 
$storage_size_bigobj
+    $upload_storage_args = join([
+        "-s 
main1=persistent,/srv/${::role::cache::2layer::storage_parts[0]}/varnish.main1,${storage_size_up}G,${::role::cache::2layer::mma[0]}",
+        "-s 
main2=persistent,/srv/${::role::cache::2layer::storage_parts[1]}/varnish.main2,${storage_size_up}G,${::role::cache::2layer::mma[1]}",
+        "-s 
bigobj1=file,/srv/${::role::cache::2layer::storage_parts[0]}/varnish.bigobj1,${storage_size_bigobj}G",
+        "-s 
bigobj2=file,/srv/${::role::cache::2layer::storage_parts[1]}/varnish.bigobj2,${storage_size_bigobj}G",
+    ], ' ')
 
-    $storage_size_bigobj = floor($storage_size_main / 6)
-    $storage_size_up = $storage_size_main - $storage_size_bigobj
-    $storage_conf =  $::realm ? {
-        'production' => "-s 
main1=persistent,/srv/sda3/varnish.main1,${storage_size_up}G,$mma0 -s 
main2=persistent,/srv/sdb3/varnish.main2,${storage_size_up}G,$mma1 -s 
bigobj1=file,/srv/sda3/varnish.bigobj1,${storage_size_bigobj}G -s 
bigobj2=file,/srv/sdb3/varnish.bigobj2,${storage_size_bigobj}G",
-        'labs'       => "-s 
main1=persistent,/srv/vdb/varnish.main1,${storage_size_up}G,$mma0 -s 
main2=persistent,/srv/vdb/varnish.main2,${storage_size_up}G,$mma1 -s 
bigobj1=file,/srv/vdb/varnish.bigobj1,${storage_size_bigobj}G -s 
bigobj2=file,/srv/vdb/varnish.bigobj2,${storage_size_bigobj}G"
-    }
-
-    $director_type_cluster = $cluster_tier ? {
+    $director_type_cluster = $::role::cache::base::cluster_tier ? {
         1       => 'random',
         default => 'chash',
     }
@@ -105,22 +94,22 @@
         port               => 3128,
         admin_port         => 6083,
         runtime_parameters => $runtime_params,
-        storage            => $storage_conf,
-        directors          => $varnish_be_directors[$cluster_tier],
+        storage            => $upload_storage_args,
+        directors          => 
$varnish_be_directors[$::role::cache::base::cluster_tier],
         director_type      => $director_type_cluster,
         director_options   => {
             'retries' => $director_retries,
         },
         vcl_config         => {
-            'default_backend'  => $default_backend,
+            'default_backend'  => $::role::cache::base::default_backend,
             'retry5xx'         => 0,
             'cache4xx'         => '1m',
-            'purge_host_regex' => $purge_host_only_upload_re,
-            'cluster_tier'     => $cluster_tier,
+            'purge_host_regex' => 
$::role::cache::base::purge_host_only_upload_re,
+            'cluster_tier'     => $::role::cache::base::cluster_tier,
             'layer'            => 'backend',
-            'ssl_proxies'      => $wikimedia_networks,
+            'ssl_proxies'      => $::role::cache::base::wikimedia_networks,
         },
-        backend_options    => array_concat($backend_scaled_weights, [
+        backend_options    => 
array_concat($::role::cache::2layer::backend_scaled_weights, [
             {
                 'backend_match' => '^cp[0-9]+\.eqiad.wmnet$',
                 'port'          => 3128,
@@ -135,7 +124,7 @@
             },
         ]),
         cluster_options    => $cluster_options,
-        wikimedia_networks => $wikimedia_networks,
+        wikimedia_networks => $::role::cache::base::wikimedia_networks,
     }
 
     varnish::instance { 'upload-frontend':
@@ -151,12 +140,12 @@
         vcl_config      => {
             'retry5xx'         => 0,
             'cache4xx'         => '1m',
-            'purge_host_regex' => $purge_host_only_upload_re,
-            'cluster_tier'     => $cluster_tier,
+            'purge_host_regex' => 
$::role::cache::base::purge_host_only_upload_re,
+            'cluster_tier'     => $::role::cache::base::cluster_tier,
             'layer'            => 'frontend',
-            'ssl_proxies'      => $wikimedia_networks,
+            'ssl_proxies'      => $::role::cache::base::wikimedia_networks,
         },
-        backend_options => array_concat($backend_scaled_weights, [
+        backend_options => 
array_concat($::role::cache::2layer::backend_scaled_weights, [
             {
                 'port'                  => 3128,
                 'connect_timeout'       => '5s',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I23f4cccd2015b35246e7e7cfd93ee979be2e6a3c
Gerrit-PatchSet: 17
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack <[email protected]>
Gerrit-Reviewer: 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

Reply via email to