From 61bbe6530eaf19bfedb09a923184763e130bf6c9 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 28 Jul 2010 16:34:36 -0300 Subject: Making ikiwiki-refresh to call ikiwiki-deploy if needed --- manifests/init.pp | 15 +++++---------- templates/deploy.sh.erb | 12 ++++++++---- templates/refresh.sh.erb | 5 +++++ 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index a36cc55..e6eeee2 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -47,12 +47,6 @@ class ikiwiki { command => "/usr/local/sbin/ikiwiki-refresh $name $instance", user => root, refreshonly => true, - onlyif => "/bin/sh -c '[ ! -f ${apache_sites_folder}/${name}/${instance}_src/index.mdwn ]'", - } - - exec { "/usr/local/sbin/ikiwiki-deploy $name $instance": - creates => "${apache_sites_folder}/${name}/${instance}_src/index.mdwn", - user => root, } if !defined(File["${apache_sites_folder}/${name}/${instance}_src"]) { @@ -95,10 +89,11 @@ class ikiwiki { # file { [ "/var/git/repositories/${name}.git/hooks/post-update", "${apache_sites_folder}/${name}/${instance}/ikiwiki.cgi" ]: - ensure => present, - owner => www-data, - group => gitosis, - mode => 6550, + ensure => present, + owner => www-data, + group => gitosis, + mode => 6550, + require => File["/etc/ikiwiki/$name.setup"], } } 'absent': { diff --git a/templates/deploy.sh.erb b/templates/deploy.sh.erb index 07760ec..e5bfa92 100644 --- a/templates/deploy.sh.erb +++ b/templates/deploy.sh.erb @@ -25,7 +25,8 @@ fi mkdir -p $SITE/"$INSTANCE"_src/ # Create initial page -echo > $SITE/"$INSTANCE"_src/index.mdwn < $SITE/"$INSTANCE"_src/index.mdwn <