aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-01-06 22:44:37 -0200
committerSilvio Rhatto <rhatto@riseup.net>2010-01-06 22:44:37 -0200
commita1f92c75e44453e7a85c2de7609bf80e1ed92b8c (patch)
tree92aa3c56ff0ccb34dd538b20dfef26c71cf36fba
parent2d980c562685ed385a949a3cc82dea3d69215671 (diff)
downloadpuppet-ikiwiki-a1f92c75e44453e7a85c2de7609bf80e1ed92b8c.tar.gz
puppet-ikiwiki-a1f92c75e44453e7a85c2de7609bf80e1ed92b8c.tar.bz2
Adding ensure into ikiwiki::instance
-rw-r--r--manifests/init.pp38
1 files changed, 21 insertions, 17 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 05707d7..1cef3e6 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -15,30 +15,34 @@ class ikiwiki {
mode => 755,
}
- define instance() {
+ define instance($ensure = 'present') {
file { "/etc/ikiwiki/$name.setup":
- ensure => present,
+ ensure => $ensure,
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" ]:
- ensure => directory,
- owner => gitosis,
- group => gitosis,
- recurse => true,
- notify => Exec["ikiwiki --setup /etc/ikiwiki/$name.setup"],
+ case $ensure {
+ 'present': {
+ 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" ]:
+ ensure => directory,
+ owner => gitosis,
+ group => gitosis,
+ recurse => true,
+ notify => Exec["ikiwiki --setup /etc/ikiwiki/$name.setup"],
+ }
+ }
}
}
}