]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
planet vhost
authorPeter Palfrader <peter@palfrader.org>
Sun, 9 Dec 2012 11:39:45 +0000 (12:39 +0100)
committerPeter Palfrader <peter@palfrader.org>
Sun, 9 Dec 2012 11:39:45 +0000 (12:39 +0100)
modules/roles/files/static-mirroring/vhost/planet.debian.org [new file with mode: 0644]
modules/roles/manifests/static_mirror.pp
modules/roles/templates/static-mirroring/apache-conf-static-mirror-macros.erb [new file with mode: 0644]

diff --git a/modules/roles/files/static-mirroring/vhost/planet.debian.org b/modules/roles/files/static-mirroring/vhost/planet.debian.org
new file mode 100644 (file)
index 0000000..22bf348
--- /dev/null
@@ -0,0 +1,22 @@
+Use DebianStaticMirrorVhostLine
+       ServerName planet.debian.org
+       ServerAlias planet.debian.net planeta.debian.net
+       ServerAdmin planet@debian.org
+
+       ErrorLog /var/log/apache2/planet.debian.org-error.log
+       CustomLog /var/log/apache2/planet.debian.org-access.log combined
+
+       <IfModule mod_userdir.c>
+               UserDir disabled
+       </IfModule>
+
+       DocumentRoot /srv/static.debian.org/cur/planet.debian.org
+       AddDefaultCharset utf-8
+
+       RewriteEngine On
+       RewriteCond %{HTTP_HOST} ^planeta.debian.net$ [NC]
+       RewriteRule ^/(.*)        http://planet.debian.org/es/$1  [R=permanent,L]
+       RewriteCond %{HTTP_HOST} ^planet.debian.net$ [NC]
+       RewriteRule ^/(.*)        http://planet.debian.org/$1  [R=permanent,L]
+</VirtualHost>
+# vim:set syn=apache:
index 67f5478e6d808030e354bac5c21a45102fe80923..390e56338ca06e0271890c15cdb3c2a175ea6e00 100644 (file)
@@ -25,26 +25,16 @@ class roles::static_mirror inherits roles::static_source {
             content => "PATH=/usr/local/bin:/usr/bin:/bin\n@reboot staticsync sleep 60; static-mirror-run --one-stage /srv/static.debian.org bizet.debian.org:-live- > /dev/null\n",
             ;
 
-        #"/etc/apache2/sites-available/dist.torproject.org":
-        #    source  => "puppet:///modules/roles/static-mirroring/vhost/dist.torproject.org",
-        #    require => Package["apache2"],
-        #    notify  => Exec["reload-apache2"],
-        #    ;
-        #"/etc/apache2/sites-available/www.torproject.org":
-        #    source  => "puppet:///modules/roles/static-mirroring/vhost/www.torproject.org",
-        #    require => Package["apache2"],
-        #    notify  => Exec["reload-apache2"],
-        #    ;
     }
 
-    #apache2::activate_apache_site {
-    #    "10-dist.torproject.org":
-    #        site => "dist.torproject.org",
-    #        require => File['/etc/ssl/certs/apache-wildcard.torproject.org.pem'];
-    #    "10-www.torproject.org":
-    #        site => "www.torproject.org",
-    #        require => File['/etc/ssl/certs/apache-wildcard.torproject.org.pem'];
-    #}
+    apache2::config { 'static-mirror-macros':
+        content => template('roles/static-mirroring/apache-conf-static-mirror-macros.erb'),
+    }
+
+    apache2::site { '010-planet.debian.org':
+        site   => 'planet.debian.org',
+        source => 'puppet:///modules/roles/static-mirroring/vhost/planet.debian.org',
+    }
 }
 # vim:set et:
 # vim:set sts=4 ts=4:
diff --git a/modules/roles/templates/static-mirroring/apache-conf-static-mirror-macros.erb b/modules/roles/templates/static-mirroring/apache-conf-static-mirror-macros.erb
new file mode 100644 (file)
index 0000000..20d2d97
--- /dev/null
@@ -0,0 +1,11 @@
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+##
+
+<Macro DebianStaticMirrorVhostLine>
+<% if hostname == "klecker" -%>
+  <VirtualHost 130.89.148.14:80 2001:610:1908:b000::148:14:80>
+<% else -%>
+  <VirtualHost *:80>
+<% end -%>
+</Macro>