aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mediawiki/manifests/init.pp
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2011-06-15 17:17:26 +0000
committerMichael Scherer <misc@mageia.org>2011-06-15 17:17:26 +0000
commit5879742dd95ca15fe7d4e54adea3afa5dc7c3cdf (patch)
tree50eb2c482e6f2f5a11a8a2373745e88b039353f6 /modules/mediawiki/manifests/init.pp
parent146a868c3fa1f13c978ab570529a090df13315bd (diff)
downloadpuppet-5879742dd95ca15fe7d4e54adea3afa5dc7c3cdf.tar
puppet-5879742dd95ca15fe7d4e54adea3afa5dc7c3cdf.tar.gz
puppet-5879742dd95ca15fe7d4e54adea3afa5dc7c3cdf.tar.bz2
puppet-5879742dd95ca15fe7d4e54adea3afa5dc7c3cdf.tar.xz
puppet-5879742dd95ca15fe7d4e54adea3afa5dc7c3cdf.zip
finish the mediawiki module ( at least, to a state were I get a wiki
running on my vm )
Diffstat (limited to 'modules/mediawiki/manifests/init.pp')
-rw-r--r--modules/mediawiki/manifests/init.pp61
1 files changed, 56 insertions, 5 deletions
diff --git a/modules/mediawiki/manifests/init.pp b/modules/mediawiki/manifests/init.pp
index b4f60061..1058e499 100644
--- a/modules/mediawiki/manifests/init.pp
+++ b/modules/mediawiki/manifests/init.pp
@@ -1,9 +1,20 @@
class mediawiki {
class base {
+
+ $root = "/srv/wiki/"
+
+ include apache::mod_php
+
package { "mediawiki-minimal":
ensure => installed,
}
-
+
+ file { $root:
+ ensure => directory,
+ }
+
+ $user = "mediawiki"
+
$pgsql_password = extlookup("mediawiki_pgsql",'x')
@@postgresql::user { $user:
password => $pgsql_password,
@@ -13,15 +24,55 @@ class mediawiki {
$ldap_password = extlookup('mediawiki_ldap','x')
# TODO write the web configuration
+ apache::vhost_base { "wiki.$domain":
+ location => $root,
+ content => template("mediawiki/wiki_vhost.conf"),
+ }
+
+ apache::vhost_base { "ssl_wiki.$domain":
+ location => $root,
+ use_ssl => true,
+ vhost => "wiki.$domain",
+ content => template("mediawiki/wiki_vhost.conf"),
+ }
+
+
# add index.php
}
# do wiki basic installation
- define instance {
- # define a db per instance
- # install / link source code
- # add config file
+ define instance($title) {
+
+ include mediawiki::base
+
+ $path = $name
+ $lang = $name
+ $wiki_root = "$mediawiki::base::root/$path"
+ $db_name = "mediawiki_$name"
+ $db_user = "$mediawiki::base::user"
+ $db_password = "$mediawiki::base::pgsql_password"
+ $secret_key = extlookup("mediawiki_secretkey",'x')
+
+ file { "$wiki_root":
+ ensure => directory
+ }
+
+ exec { "wikicreate $name":
+ command => "mediawiki-create $wiki_root",
+ cwd => "$mediawiki::base::root",
+ require => [File["$wiki_root"],Package['mediawiki-minimal']],
+ creates => "$wiki_root/index.php",
+ }
+
+ postgresql::database { "$db_name":
+ user => $db_user,
+ }
+
+ file { "$wiki_root/LocalSettings.php":
+ ensure => present,
+ content => template("mediawiki/LocalSettings.php")
+ }
}
}