ArielGlenn has submitted this change and it was merged. (
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, 37 insertions(+), 25 deletions(-)
Approvals:
ArielGlenn: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/dumps/manifests/web/htmldumps.pp
b/modules/dumps/manifests/web/htmldumps.pp
index 1934e2e..adf6229 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,8 +29,8 @@
}
nginx::site { 'htmldumps':
- source => 'puppet:///modules/dumps/web/htmldumps/nginx.conf',
- notify => Service['nginx'],
+ 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..ac148be 100644
--- a/modules/dumps/manifests/web/xmldumps_active.pp
+++ b/modules/dumps/manifests/web/xmldumps_active.pp
@@ -4,13 +4,17 @@
$publicdir = undef,
$otherdir = undef,
$logs_dest = undef,
+ $htmldumps_server = undef,
+ $xmldumps_server = undef,
) {
# active web server
class {'::dumps::web::xmldumps':
- do_acme => $do_acme,
- datadir => $datadir,
- publicdir => $publicdir,
- otherdir => $otherdir,
+ do_acme => $do_acme,
+ datadir => $datadir,
+ publicdir => $publicdir,
+ otherdir => $otherdir,
+ htmldumps_server => $htmldumps_server,
+ xmldumps_server => $xmldumps_server,
}
# only the active web server should be syncing nginx logs
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..5cacabe 100644
--- a/modules/profile/manifests/dumps/web/xmldumps_active.pp
+++ b/modules/profile/manifests/dumps/web/xmldumps_active.pp
@@ -1,10 +1,12 @@
class profile::dumps::web::xmldumps_active {
class {'::dumps::web::xmldumps_active':
- do_acme => hiera('do_acme'),
- datadir => '/data/xmldatadumps',
- publicdir => '/data/xmldatadumps/public',
- otherdir => '/data/xmldatadumps/public/other',
- logs_dest =>
'stat1005.eqiad.wmnet::srv/log/webrequest/archive/dumps.wikimedia.org/',
+ do_acme => hiera('do_acme'),
+ datadir => '/data/xmldatadumps',
+ 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..c209ac8 100644
--- a/modules/profile/manifests/dumps/web/xmldumps_fallback.pp
+++ b/modules/profile/manifests/dumps/web/xmldumps_fallback.pp
@@ -1,8 +1,10 @@
class profile::dumps::web::xmldumps_fallback {
class {'::dumps::web::xmldumps':
- do_acme => hiera('do_acme'),
- datadir => '/data/xmldatadumps',
- publicdir => '/data/xmldatadumps/public',
- otherdir => '/data/xmldatadumps/public/other',
+ do_acme => hiera('do_acme'),
+ 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: merged
Gerrit-Change-Id: Iad2ee2040297702649fdeeae5392d22152cd6449
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: ArielGlenn <[email protected]>
Gerrit-Reviewer: ArielGlenn <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits