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($ensure = 'present') { file { "/etc/ikiwiki/$name.setup": ensure => $ensure, content => template('ikiwiki/ikiwiki.setup.erb'), owner => root, group => root, mode => 644, } 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' ]", } 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"], } } } } } }