From 2d304317118ecb8296bcc3ed489dea7af7828b03 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 11 Apr 2013 20:44:59 -0300 Subject: Adding git_folder parameter --- manifests/init.pp | 3 ++- manifests/instance.pp | 2 +- templates/deploy.sh.erb | 2 +- templates/refresh.sh.erb | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index b2c25b2..74edacd 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,7 +1,8 @@ class ikiwiki( $sites_folder = '/var/sites', $git_implementation = 'gitolite', - $www_user = 'www-data' + $www_user = 'www-data', + $git_folder = '/var/git/repositories' ) { package { [ "ikiwiki", "po4a" ]: ensure => installed, diff --git a/manifests/instance.pp b/manifests/instance.pp index c7648da..a8ed0d9 100644 --- a/manifests/instance.pp +++ b/manifests/instance.pp @@ -95,7 +95,7 @@ define ikiwiki::instance( } # See http://rtime.felk.cvut.cz/~sojka/blog/using-ikiwiki-with-gitolite/ - file { "/var/git/repositories/${name}.git/hooks/post-update": + file { "${ikiwiki::git_folder}/${name}.git/hooks/post-update": ensure => present, owner => $owner, group => $ikiwiki::git_implementation, diff --git a/templates/deploy.sh.erb b/templates/deploy.sh.erb index e895546..2673d3a 100644 --- a/templates/deploy.sh.erb +++ b/templates/deploy.sh.erb @@ -12,8 +12,8 @@ INSTANCE="ikiwiki" CONF="/etc/ikiwiki" BASE="<%= scope.lookupvar('ikiwiki::sites_folder') %>" REPO_OWNER="<%= scope.lookupvar('ikiwiki::git_implementation') %>" +REPO="<%= scope.lookupvar('ikiwiki::git_folder') %>/$NAME.git" REMOTE="$REPO_OWNER@localhost:$NAME" -REPO="/var/git/repositories/$NAME.git" # Syntax check if [ -z "$INSTANCE" ]; then diff --git a/templates/refresh.sh.erb b/templates/refresh.sh.erb index 10b96c1..7e7adf6 100644 --- a/templates/refresh.sh.erb +++ b/templates/refresh.sh.erb @@ -14,7 +14,7 @@ WWW_USER="<%= scope.lookupvar('ikiwiki::www_user') %>" BASE="<%= scope.lookupvar('ikiwiki::sites_folder') %>" REPO_OWNER="<%= scope.lookupvar('ikiwiki::git_implementation') %>" REPO_GROUP="<%= scope.lookupvar('ikiwiki::git_implementation') %>" -REPO="/var/git/repositories/$NAME.git" +REPO="<%= scope.lookupvar('ikiwiki::git_folder') %>/$NAME.git" # Syntax check if [ -z "$INSTANCE" ]; then -- cgit v1.2.3