aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2011-10-22 23:55:54 +0000
committerNicolas Vigier <boklm@mageia.org>2011-10-22 23:55:54 +0000
commite625d57308bddda149bf123e4305d5fe3e6bb81b (patch)
treef18b5ff2fe5669ee27fd76af640cbe7b7a216158
parentec2935e22a4a302b1f09178f9db6e2e54dc9f5b5 (diff)
downloadpuppet-e625d57308bddda149bf123e4305d5fe3e6bb81b.tar
puppet-e625d57308bddda149bf123e4305d5fe3e6bb81b.tar.gz
puppet-e625d57308bddda149bf123e4305d5fe3e6bb81b.tar.bz2
puppet-e625d57308bddda149bf123e4305d5fe3e6bb81b.tar.xz
puppet-e625d57308bddda149bf123e4305d5fe3e6bb81b.zip
define wiki vhost in deployement/wikis
-rw-r--r--deployment/wikis/manifests/init.pp13
-rw-r--r--deployment/wikis/templates/wiki_vhost.conf14
2 files changed, 27 insertions, 0 deletions
diff --git a/deployment/wikis/manifests/init.pp b/deployment/wikis/manifests/init.pp
index 2198e557..e37bb74a 100644
--- a/deployment/wikis/manifests/init.pp
+++ b/deployment/wikis/manifests/init.pp
@@ -1,12 +1,25 @@
class wikis {
+ $wikis_root = '/srv/wiki'
class { "mediawiki::config":
pgsql_password => extlookup("mediawiki_pgsql",'x'),
secretkey => extlookup("mediawiki_secretkey",'x'),
ldap_password => extlookup('mediawiki_ldap','x'),
+ root => $wikis_root,
+ vhost => false,
}
+ $wiki_languages = [ 'en', 'fr' ]
mediawiki::instance { "en":
title => "Mageia wiki",
wiki_settings => template('wikis/wiki_settings'),
}
+
+ apache::vhost_redirect_ssl { "wiki.$domain": }
+
+ apache::vhost_base { "ssl_wiki.$domain":
+ location => '/dev/null',
+ use_ssl => true,
+ vhost => "wiki.$domain",
+ content => template("wiki/wiki_vhost.conf"),
+ }
}
diff --git a/deployment/wikis/templates/wiki_vhost.conf b/deployment/wikis/templates/wiki_vhost.conf
new file mode 100644
index 00000000..28f59ad3
--- /dev/null
+++ b/deployment/wikis/templates/wiki_vhost.conf
@@ -0,0 +1,14 @@
+<Directory <%= wikis_root %>>
+ Options +FollowSymLinks
+</Directory>
+
+RewriteEngine On
+RewriteRule ^/?$ /en/ [R]
+
+<%- for lang in wiki_languages -%>
+
+Alias /<%= lang %> <%= wikis_root %>/<%= lang %>/index.php
+Alias /mw-<%= lang %> <%= wikis_root %>/<%= lang %>
+
+<%- end -%>
+