diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/init.pp | 39 |
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"], + } + } } |