From 3cdf7724a49fd2546d1e5a35c44531540e275aa1 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 9 Dec 2012 12:39:45 +0100 Subject: [PATCH] planet vhost --- .../static-mirroring/vhost/planet.debian.org | 22 ++++++++++++++++ modules/roles/manifests/static_mirror.pp | 26 ++++++------------- .../apache-conf-static-mirror-macros.erb | 11 ++++++++ 3 files changed, 41 insertions(+), 18 deletions(-) create mode 100644 modules/roles/files/static-mirroring/vhost/planet.debian.org create mode 100644 modules/roles/templates/static-mirroring/apache-conf-static-mirror-macros.erb 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 index 000000000..22bf348b5 --- /dev/null +++ b/modules/roles/files/static-mirroring/vhost/planet.debian.org @@ -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 + + + UserDir disabled + + + 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] + +# vim:set syn=apache: diff --git a/modules/roles/manifests/static_mirror.pp b/modules/roles/manifests/static_mirror.pp index 67f5478e6..390e56338 100644 --- a/modules/roles/manifests/static_mirror.pp +++ b/modules/roles/manifests/static_mirror.pp @@ -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 index 000000000..20d2d971a --- /dev/null +++ b/modules/roles/templates/static-mirroring/apache-conf-static-mirror-macros.erb @@ -0,0 +1,11 @@ +## +## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE. +## + + +<% if hostname == "klecker" -%> + +<% else -%> + +<% end -%> + -- 2.20.1