aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-01-06 22:37:49 -0200
committerSilvio Rhatto <rhatto@riseup.net>2010-01-06 22:37:49 -0200
commita9e94c261c5d76454a5d8b037c002baf6efbedfc (patch)
treee896730f057439e9dc623aaca35ca04cfcc92fc8 /manifests
parentbc59ef1fb7cf67c5451cae0c83ef187af86c9900 (diff)
downloadpuppet-ikiwiki-a9e94c261c5d76454a5d8b037c002baf6efbedfc.tar.gz
puppet-ikiwiki-a9e94c261c5d76454a5d8b037c002baf6efbedfc.tar.bz2
Adding ikiwiki::instance
Diffstat (limited to 'manifests')
-rw-r--r--manifests/init.pp39
1 files changed, 39 insertions, 0 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index bc83789..c4b58d2 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -2,4 +2,43 @@ class ikiwiki {
package { "ikiwiki":
ensure => installed,
}
+
+ case $apache_sites_folder {
+ '': { fail("you need to define \$apache_sites_folder for drupal module") }
+ }
+
+ file { "/usr/local/sbin/ikiwiki-deploy":
+ ensure => present,
+ content => template('ikiwiki/deploy.sh.erb'),
+ owner => root,
+ group => root,
+ mode => 755,
+ }
+
+ define instance() {
+ file { "/etc/ikiwiki/$name.setup":
+ ensure => present,
+ content => template('ikiwiki/ikiwiki.setup.erb'),
+ owner => root,
+ group => root,
+ mode => 644,
+ }
+
+ exec { "ikiwiki --setup /etc/ikiwiki/$name.setup":
+ user => gitosis,
+ refreshonly => true,
+ }
+
+ exec { "/usr/local/sbin/ikiwiki-deploy $name":
+ unless => "/bin/sh -c [ -f '${apache_sites_folder}/${name}_src/index.mdw' ]",
+ }
+
+ file { [ "${apache_sites_folder}/${name}_src", "${apache_sites_folder}/${name}" ]:
+ ensure => directory,
+ owner => gitosis,
+ group => gitosis,
+ recurse => true,
+ notify => Exec["ikiwiki --setup /etc/ikiwiki/$name.setup"],
+ }
+ }
}