aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-01-07 00:59:06 -0200
committerSilvio Rhatto <rhatto@riseup.net>2010-01-07 00:59:06 -0200
commitfba0e7902c6471c20a3aa7448701fe2a62d8037b (patch)
treebf9f25210039805ce7ca4c45f3881435c07e85c0
parent5c8006d043737f482a45d3655dda283d324111a3 (diff)
downloadpuppet-ikiwiki-fba0e7902c6471c20a3aa7448701fe2a62d8037b.tar.gz
puppet-ikiwiki-fba0e7902c6471c20a3aa7448701fe2a62d8037b.tar.bz2
Adding $base_url; minor fix
-rw-r--r--manifests/init.pp11
-rw-r--r--templates/ikiwiki.setup.erb4
2 files changed, 11 insertions, 4 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 20561d8..30fb521 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -15,13 +15,20 @@ class ikiwiki {
mode => 755,
}
- define instance($ensure = 'present') {
+ define instance($base_url = false, $ensure = 'present') {
+
+ $ikiwiki_base = $base_url ? {
+ false => $domain,
+ default => $base_url,
+ }
+
file { "/etc/ikiwiki/$name.setup":
ensure => $ensure,
content => template('ikiwiki/ikiwiki.setup.erb'),
owner => root,
group => root,
mode => 644,
+ notify => Exec["ikiwiki --setup /etc/ikiwiki/$name.setup"],
}
case $ensure {
@@ -32,7 +39,7 @@ class ikiwiki {
}
exec { "/usr/local/sbin/ikiwiki-deploy $name":
- unless => "/bin/sh -c [ -f '${apache_sites_folder}/${name}/ikiwiki_src/index.mdw' ]",
+ unless => "/bin/sh -c '[ -f ${apache_sites_folder}/${name}/ikiwiki_src/index.mdw ]'",
user => root,
}
diff --git a/templates/ikiwiki.setup.erb b/templates/ikiwiki.setup.erb
index 927e760..c42a7e3 100644
--- a/templates/ikiwiki.setup.erb
+++ b/templates/ikiwiki.setup.erb
@@ -14,8 +14,8 @@ use IkiWiki::Setup::Standard {
srcdir => "<%= apache_sites_folder %>/<%= name %>/ikiwiki_src",
destdir => "<%= apache_sites_folder %>/<%= name %>/ikiwiki",
- url => "http://example.org/wiki",
- cgiurl => "http://example.org/wiki/ikiwiki.cgi",
+ url => "http://<%= name %>.<%= ikiwiki_base %>",
+ cgiurl => "http://<%= name %>.<%= ikiwiki_base %>/ikiwiki.cgi",
#templatedir => "/usr/share/ikiwiki/templates",
#underlaydir => "/usr/share/ikiwiki/basewiki",