aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/init.pp26
-rw-r--r--templates/deploy.sh.erb1
2 files changed, 20 insertions, 7 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 1cef3e6..35b7b8d 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -32,15 +32,27 @@ class ikiwiki {
}
exec { "/usr/local/sbin/ikiwiki-deploy $name":
- unless => "/bin/sh -c [ -f '${apache_sites_folder}/${name}_src/index.mdw' ]",
+ unless => "/bin/sh -c [ -f '${apache_sites_folder}/${name}_src/index.mdw' ]",
}
- file { [ "${apache_sites_folder}/${name}_src" ]:
- ensure => directory,
- owner => gitosis,
- group => gitosis,
- recurse => true,
- notify => Exec["ikiwiki --setup /etc/ikiwiki/$name.setup"],
+ if !defined(File["${apache_sites_folder}/${name}_src"]) {
+ file { "${apache_sites_folder}/${name}_src":
+ ensure => directory,
+ owner => gitosis,
+ group => gitosis,
+ recurse => true,
+ notify => Exec["ikiwiki --setup /etc/ikiwiki/$name.setup"],
+ }
+ }
+
+ if !defined(File["${apache_sites_folder}/${name}"]) {
+ file { "${apache_sites_folder}/${name}":
+ ensure => directory,
+ owner => gitosis,
+ group => gitosis,
+ recurse => true,
+ notify => Exec["ikiwiki --setup /etc/ikiwiki/$name.setup"],
+ }
}
}
}
diff --git a/templates/deploy.sh.erb b/templates/deploy.sh.erb
index e98b57c..19aa514 100644
--- a/templates/deploy.sh.erb
+++ b/templates/deploy.sh.erb
@@ -13,6 +13,7 @@ if [ ! -e "$CONF/$NAME" ]; then
echo "No config file for $NAME"
fi
+mkdir -p $SITE/ikiwiki_src/
echo > $SITE/ikiwiki_src/index.mdw <<EOF
Welcome to your new wiki.