ArielGlenn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381525 )

Change subject: move hardcoded refs to francium, dumps.wm.o out of dumps 
manifests to profiles
......................................................................

move hardcoded refs to francium, dumps.wm.o out of dumps manifests to profiles

Change-Id: Iad2ee2040297702649fdeeae5392d22152cd6449
---
M modules/dumps/manifests/web/htmldumps.pp
M modules/dumps/manifests/web/xmldumps.pp
M modules/dumps/manifests/web/xmldumps_active.pp
R modules/dumps/templates/web/htmldumps/nginx.conf.erb
M modules/dumps/templates/web/xmldumps/nginx.conf.erb
M modules/profile/manifests/dumps/web/htmldumps.pp
M modules/profile/manifests/dumps/web/xmldumps_active.pp
M modules/profile/manifests/dumps/web/xmldumps_fallback.pp
8 files changed, 21 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/25/381525/1

diff --git a/modules/dumps/manifests/web/htmldumps.pp 
b/modules/dumps/manifests/web/htmldumps.pp
index 1934e2e..e4f6806 100644
--- a/modules/dumps/manifests/web/htmldumps.pp
+++ b/modules/dumps/manifests/web/htmldumps.pp
@@ -1,5 +1,7 @@
 # serve dumps of revision content from restbase in html format
-class dumps::web::htmldumps {
+class dumps::web::htmldumps(
+    $htmldumps_server = undef,
+) {
 
     # nginx serving these via http only, with another host
     # proxying all requests. can't use the standard dumps nginx
@@ -27,7 +29,7 @@
     }
 
     nginx::site { 'htmldumps':
-        source => 'puppet:///modules/dumps/web/htmldumps/nginx.conf',
+        content => template('dumps/web/htmldumps/nginx.conf.erb)',
         notify => Service['nginx'],
     }
     include dumps::web::nginx_logrot
diff --git a/modules/dumps/manifests/web/xmldumps.pp 
b/modules/dumps/manifests/web/xmldumps.pp
index 5a3f1f8..2f3337a 100644
--- a/modules/dumps/manifests/web/xmldumps.pp
+++ b/modules/dumps/manifests/web/xmldumps.pp
@@ -4,6 +4,8 @@
     $datadir = undef,
     $publicdir = undef,
     $otherdir = undef,
+    $htmldumps_server = undef,
+    $xmldumps_server = undef,
 ) {
 
     class {'dumps::web::html':
@@ -19,7 +21,7 @@
     $ssl_settings = ssl_ciphersuite('nginx', 'mid', true)
 
     letsencrypt::cert::integrated { 'dumps':
-        subjects   => 'dumps.wikimedia.org',
+        subjects   => $xmldumps_server,
         puppet_svc => 'nginx',
         system_svc => 'nginx',
     }
@@ -57,7 +59,7 @@
     if ($do_acme == true) {
         monitoring::service { 'https':
             description   => 'HTTPS',
-            check_command => 'check_ssl_http_letsencrypt!dumps.wikimedia.org',
+            check_command => "check_ssl_http_letsencrypt!${xmldumps_server}",
         }
     }
 }
diff --git a/modules/dumps/manifests/web/xmldumps_active.pp 
b/modules/dumps/manifests/web/xmldumps_active.pp
index 57a6e21..e773faa 100644
--- a/modules/dumps/manifests/web/xmldumps_active.pp
+++ b/modules/dumps/manifests/web/xmldumps_active.pp
@@ -4,6 +4,8 @@
     $publicdir = undef,
     $otherdir = undef,
     $logs_dest = undef,
+    $htmldumps_server = undef,
+    $xmldumps_server = undef,
 ) {
     # active web server
     class {'::dumps::web::xmldumps':
diff --git a/modules/dumps/files/web/htmldumps/nginx.conf 
b/modules/dumps/templates/web/htmldumps/nginx.conf.erb
similarity index 91%
rename from modules/dumps/files/web/htmldumps/nginx.conf
rename to modules/dumps/templates/web/htmldumps/nginx.conf.erb
index 9e26b33..1db997c 100644
--- a/modules/dumps/files/web/htmldumps/nginx.conf
+++ b/modules/dumps/templates/web/htmldumps/nginx.conf.erb
@@ -7,7 +7,7 @@
 
 server {
    listen 80;
-   server_name francium.eqiad.wmnet;
+   server_name <%= @htmldumps_server %>;
 
    root /srv/www;
 
diff --git a/modules/dumps/templates/web/xmldumps/nginx.conf.erb 
b/modules/dumps/templates/web/xmldumps/nginx.conf.erb
index 75ba0b1..3202687 100644
--- a/modules/dumps/templates/web/xmldumps/nginx.conf.erb
+++ b/modules/dumps/templates/web/xmldumps/nginx.conf.erb
@@ -7,14 +7,14 @@
 
 server {
    listen [::]:80 default ipv6only=off;
-   server_name dumps.wikimedia.org;
+   server_name <%= @xmldumps_server %>;
 
-   return 301 https://dumps.wikimedia.org$request_uri;
+   return 301 https://<%= @xmldumps_server %>$request_uri;
 }
 
 server {
    listen [::]:443 default ssl ipv6only=off;
-   server_name dumps.wikimedia.org;
+   server_name <%= @xmldumps_server %>;
 
    include /etc/acme/challenge-nginx.conf;
 
@@ -41,13 +41,13 @@
    rewrite ^/fundraising(|/.*)$                       /other/fundraising$1 
permanent;
    rewrite ^/analytics(|/.*)$                         /other/analytics$1 
permanent;
 
-   # for now we proxy for html (openzim style) dumps
+   # for now we proxy for html (restbase) dumps
    location /htmldumps {
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $remote_addr;
       proxy_set_header Proxy ""; # https://httpoxy.org/
-      proxy_pass http://francium.eqiad.wmnet;
+      proxy_pass http://<%= @htmldumps_server %>;
       limit_rate 8192k;
       limit_rate_after 1m;
       limit_conn addr 5;
diff --git a/modules/profile/manifests/dumps/web/htmldumps.pp 
b/modules/profile/manifests/dumps/web/htmldumps.pp
index c8cf71c..c1cdd9d 100644
--- a/modules/profile/manifests/dumps/web/htmldumps.pp
+++ b/modules/profile/manifests/dumps/web/htmldumps.pp
@@ -1,3 +1,3 @@
 class profile::dumps::web::htmldumps {
-  class {'::dumps::web::htmldumps':}
+  class {'::dumps::web::htmldumps': htmldumps_server => 'francium.eqiad.wmnet'}
 }
diff --git a/modules/profile/manifests/dumps/web/xmldumps_active.pp 
b/modules/profile/manifests/dumps/web/xmldumps_active.pp
index 5023012..5426441 100644
--- a/modules/profile/manifests/dumps/web/xmldumps_active.pp
+++ b/modules/profile/manifests/dumps/web/xmldumps_active.pp
@@ -5,6 +5,8 @@
         publicdir => '/data/xmldatadumps/public',
         otherdir  => '/data/xmldatadumps/public/other',
         logs_dest => 
'stat1005.eqiad.wmnet::srv/log/webrequest/archive/dumps.wikimedia.org/',
+        htmldumps_server => 'francium.eqiad.wmnet',
+        xmldumps_server => 'dumps.wikimedia.org',
     }
     # copy dumps and other datasets to fallback host(s) and to labs
     class {'::dumps::copying::peers':}
diff --git a/modules/profile/manifests/dumps/web/xmldumps_fallback.pp 
b/modules/profile/manifests/dumps/web/xmldumps_fallback.pp
index 4e97795..55bfd88 100644
--- a/modules/profile/manifests/dumps/web/xmldumps_fallback.pp
+++ b/modules/profile/manifests/dumps/web/xmldumps_fallback.pp
@@ -4,5 +4,7 @@
         datadir   => '/data/xmldatadumps',
         publicdir => '/data/xmldatadumps/public',
         otherdir  => '/data/xmldatadumps/public/other',
+        htmldumps_server => 'francium.eqiad.wmnet',
+        xmldumps_server => 'dumps.wikimedia.org',
     }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad2ee2040297702649fdeeae5392d22152cd6449
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: ArielGlenn <[email protected]>

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

Reply via email to