From 347d7a6eaf0449c477047db1b225c0fc9ab88a72 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 11 Apr 2013 17:32:53 -0300 Subject: Refactor scripts to run as root --- manifests/instance.pp | 2 +- templates/deploy.sh.erb | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/manifests/instance.pp b/manifests/instance.pp index e563b97..06f3cc8 100644 --- a/manifests/instance.pp +++ b/manifests/instance.pp @@ -21,7 +21,7 @@ define ikiwiki::instance($base_url = $domain, $ensure = 'present', $description exec { "ikiwiki_refresh_${name}_${instance}": command => "/usr/local/sbin/ikiwiki-refresh $name $instance $owner $group", - user => $owner, + user => root, refreshonly => true, } diff --git a/templates/deploy.sh.erb b/templates/deploy.sh.erb index 7fa4103..34064d7 100644 --- a/templates/deploy.sh.erb +++ b/templates/deploy.sh.erb @@ -5,7 +5,8 @@ INSTANCE="$2" BASE="<%= scope.lookupvar('ikiwiki::sites_folder') %>" SITE=$BASE/$NAME CONF="/etc/ikiwiki" -REPO="/var/git/repositories/$NAME.git" +REPO_OWNER="<%= scope.lookupvar('ikiwiki::git_implementation') %>" +REPO="$REPO_OWNER@localhost:$NAME" if [ -z "$INSTANCE" ]; then echo "Usage:`basename $0` " @@ -18,11 +19,11 @@ if [ ! -e "$CONF/$NAME.setup" ]; then fi # Setup source folder -mkdir -p $SITE/"$INSTANCE"_src/ +mkdir -p $SITE/"$INSTANCE"_src/ $SITE/"$INSTANCE"_src_tmp/ # Create initial page -if [ ! -e $SITE/"$INSTANCE"_src/index.mdwn ]; then - echo > $SITE/"$INSTANCE"_src/index.mdwn < $SITE/"$INSTANCE"_src_tmp/index.mdwn <