Andrew Bogott has submitted this change and it was merged.

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(-)

Approvals:
  Andrew Bogott: Verified; Looks good to me, approved
  jenkins-bot: Verified



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..678ff7a 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..e1ad57d 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: merged
Gerrit-Change-Id: Ia24c35e63fb96c377075f6ea4c1bf83736369778
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott <[email protected]>
Gerrit-Reviewer: Andrew Bogott <[email protected]>
Gerrit-Reviewer: coren <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to