summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2009-02-24 00:09:39 +0000
committermh <mh@immerda.ch>2009-02-24 00:09:39 +0000
commit2d5bcee78344e58b38dadc778474264094837f96 (patch)
tree7f969893f20fa03ec93ecaf6d081cd58f0986c33
parent79c3f3a5712e39541053f41f9c1a369828550208 (diff)
various improvements to git clone
- code style - change permission only when requested (but that's default) - name execs according to define name, otherwise you'll get duplicate names!
-rw-r--r--manifests/defines.pp37
1 files changed, 20 insertions, 17 deletions
diff --git a/manifests/defines.pp b/manifests/defines.pp
index ab5375d..e5c7a17 100644
--- a/manifests/defines.pp
+++ b/manifests/defines.pp
@@ -51,24 +51,27 @@ define git::web::repo::lighttpd(
}
define git::clone(
- $git_repo,
- $projectroot,
- $cloneddir_user='root',
- $cloneddir_group='0'
+ $git_repo,
+ $projectroot,
+ $cloneddir_user='root',
+ $cloneddir_group='0',
+ $cloneddir_restrict_mode=true
){
- exec {"git-clone":
- command => "git-clone --no-hardlinks $git_repo $projectroot",
- creates => "$projectroot/.git",
- user => root,
- notify => [Exec["git-clone-chown"],Exec["git-clone-chmod"]]
- }
- exec {"git-clone-chown":
- command => "chown -R ${cloneddir_user}:${cloneddir_group} $projectroot",
- refreshonly => true
- }
- exec {"git-clone-chmod":
- command => "chmod -R o-rwx $projectroot",
- refreshonly => true
+ exec {"git-clone_${name}":
+ command => "git-clone --no-hardlinks ${git_repo} ${projectroot}",
+ creates => "$projectroot/.git",
+ notify => Exec["git-clone-chown"],
+ }
+ exec {"git-clone-chown_${name}":
+ command => "chown -R ${cloneddir_user}:${cloneddir_group} ${projectroot}",
+ refreshonly => true,
+ }
+ if $cloneddir_restrict_mode {
+ exec {"git-clone-chmod_${name}":
+ command => "chmod -R o-rwx ${projectroot}",
+ refreshonly => true,
+ subscribe => Exec["git-clone_${name}"],
}
+ }
}