Andrew Bogott has uploaded a new change for review.
https://gerrit.wikimedia.org/r/68034
Change subject: Add a robots.txt for all labs proxy access
......................................................................
Add a robots.txt for all labs proxy access
Change-Id: Ia24c35e63fb96c377075f6ea4c1bf83736369778
---
M files/misc/robots-txt-disallow
M manifests/role/labsproxy.pp
M templates/nginx/sites/labs-proxy.erb
3 files changed, 38 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/34/68034/1
diff --git a/files/misc/robots-txt-disallow b/files/misc/robots-txt-disallow
index 1f53798..6ba092a 100644
--- a/files/misc/robots-txt-disallow
+++ b/files/misc/robots-txt-disallow
@@ -1,2 +1,6 @@
+# THIS FILE IS MANAGED BY PUPPET
+#
+# puppet:///files/misc/robots-txt-disallow
+#
User-agent: *
Disallow: /
diff --git a/manifests/role/labsproxy.pp b/manifests/role/labsproxy.pp
index 033fbff..9dad472 100644
--- a/manifests/role/labsproxy.pp
+++ b/manifests/role/labsproxy.pp
@@ -11,6 +11,21 @@
install => "template",
template => "labs-proxy";
}
+
+ file {
+ "/var/www":
+ ensure => directory,
+ owner => root,
+ group => root,
+ mode => 0555;
+ "/var/www/robots.txt":
+ ensure => present,
+ require => file["/var/www"],
+ mode => 0444,
+ owner => root,
+ group => root,
+ source => "puppet:///files/misc/robots-txt-disallow";
+ }
}
# Install an http proxy for eqiad labs instances.
@@ -26,4 +41,19 @@
install => "template",
template => "labs-proxy";
}
+
+ file {
+ "/var/www":
+ ensure => directory,
+ owner => root,
+ group => root,
+ mode => 0555;
+ "/var/www/robots.txt":
+ ensure => present,
+ require => file["/var/www"],
+ mode => 0444,
+ owner => root,
+ group => root,
+ source => "puppet:///files/misc/robots-txt-disallow";
+ }
}
diff --git a/templates/nginx/sites/labs-proxy.erb
b/templates/nginx/sites/labs-proxy.erb
index a69fdda..bbfcce0 100644
--- a/templates/nginx/sites/labs-proxy.erb
+++ b/templates/nginx/sites/labs-proxy.erb
@@ -10,6 +10,10 @@
access_log /var/log/nginx/proxy.log proxy;
access_log /var/log/nginx/access.log combined;
+ location robots.txt {
+ alias /var/www/robots.txt
+ }
+
location / {
resolver 10.4.0.1;
--
To view, visit https://gerrit.wikimedia.org/r/68034
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia24c35e63fb96c377075f6ea4c1bf83736369778
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits