Hashar has uploaded a new change for review.

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


Change subject: upload cache in labs no more rely on LVS
......................................................................

upload cache in labs no more rely on LVS

We do not have LVS support in labs, the IP configured there are
placeholders which offer no service at all.  If we ever set an
application instance in LVS configuration, its IP will be duplicated on
the caching box which cause much havoc.

This patch slightly adapt the role::cache::upload to stop relying on
$lvs::configuration::lvs_service_ips, instead use $backends to vary the
configuration between realms.  The hash learned two new keys:

- 'image_scalers'
 -> in production it points to the 'rendering' LVS IP.
 -> in labs directly to the application instances

- 'upload'
 -> in production, this is not used. The upload class reference the LVS
    IP directly.
 -> in labs directly to the application instances

This let us to the image scalers using backends['image_scalers'] for
both production and labs.  The varnish_be_backends has to be configured
using a ugly case $::realm though :(

Change-Id: I74c988920067ef09b638b06b678c372d45df3786
---
M manifests/role/cache.pp
1 file changed, 36 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/63/54863/1

diff --git a/manifests/role/cache.pp b/manifests/role/cache.pp
index 5b8d909..fa7760e 100644
--- a/manifests/role/cache.pp
+++ b/manifests/role/cache.pp
@@ -298,19 +298,30 @@
                                        'pmtpa' => [ "srv248.pmtpa.wmnet", 
"srv249.pmtpa.wmnet", "mw60.pmtpa.wmnet", "mw61.pmtpa.wmnet" ],
                                        'eqiad' => [ "mw1149.eqiad.wmnet", 
"mw1150.eqiad.wmnet", "mw1151.eqiad.wmnet", "mw1152.eqiad.wmnet" ],
                                },
+                               'image_scalers' => 
$lvs::configuration::lvs_service_ips[$::realm]['rendering'][$::mw_primary],
                                'test_appservers' => {
                                        'pmtpa' => [ "srv193.pmtpa.wmnet" ],
                                        'eqiad' => [ "srv193.pmtpa.wmnet" ],
                                },
+                               # 'upload' is unneeded in production. 
role::cache::upload references
+                               # the LVS ip directly to set up the varnish 
backends.
                        },
                        'labs' => {
                                'bits_appservers' => [
                                        '10.4.0.166',  # deployment-apache32
                                        '10.4.0.187',  # deployment-apache33
                                ],
+                               'image_scalers' => [
+                                       '10.4.0.166',  # deployment-apache32
+                                       '10.4.0.187',  # deployment-apache33
+                               ],
                                'test_appservers' => {
                                        'pmtpa' => [ '10.4.0.166' ],
-                               }
+                               },
+                               'upload' => [
+                                       '10.4.0.166',  # deployment-apache32
+                                       '10.4.0.187',  # deployment-apache33
+                               ],
                        }
                }
        }
@@ -378,18 +389,30 @@
                                "esams" => { "backend" => 
$role::cache::configuration::active_nodes[$::realm]['upload']["${::site}-varnish"]
 },
                        }
 
-                       $varnish_be_directors = {
-                               "pmtpa" => {
-                                       "backend" => 
$lvs::configuration::lvs_service_ips[$::realm]['upload']['pmtpa']['uploadsvc'],
-                                       "image_scalers" => 
$lvs::configuration::lvs_service_ips[$::realm]['rendering'][$::mw_primary],
-                               },
-                               "eqiad" => {
-                                       "backend" => 
$lvs::configuration::lvs_service_ips[$::realm]['upload']['pmtpa']['uploadsvc'],
-                                       "swift" => 
$lvs::configuration::lvs_service_ips[$::realm]['swift']['pmtpa'],
-                                       "image_scalers" => 
$lvs::configuration::lvs_service_ips[$::realm]['rendering'][$::mw_primary],
-                               },
-                               "esams" => {
-                                       "backend" => 
$lvs::configuration::lvs_service_ips[$::realm]['upload']['eqiad']['uploadlb'],
+                       case $::realm {
+                               'production': {
+                                       $varnish_be_directors = {
+                                               "pmtpa" => {
+                                                       "backend" => 
$lvs::configuration::lvs_service_ips[$::realm]['upload']['pmtpa']['uploadsvc'],
+                                                       "image_scalers" => 
$role::cache::configuration::backends[$::realm]['image_scalers'],
+                                               },
+                                               "eqiad" => {
+                                                       "backend" => 
$lvs::configuration::lvs_service_ips[$::realm]['upload']['pmtpa']['uploadsvc'],
+                                                       "swift" => 
$lvs::configuration::lvs_service_ips[$::realm]['swift']['pmtpa'],
+                                                       "image_scalers" => 
$role::cache::configuration::backends[$::realm]['image_scalers'],
+                                               },
+                                               "esams" => {
+                                                       "backend" => 
$lvs::configuration::lvs_service_ips[$::realm]['upload']['eqiad']['uploadlb'],
+                                               }
+                                       }
+                               }
+                               'labs': {
+                                       $varnish_be_directors = {
+                                               'pmtpa' => {
+                                                       'backend' => 
$role::cache::configuration::backends[$::realm]['upload'],
+                                                       'image_scalers' => 
$role::cache::configuration::backends[$::realm]['image_scalers'],
+                                               }
+                                       }
                                }
                        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I74c988920067ef09b638b06b678c372d45df3786
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar <has...@free.fr>

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

Reply via email to