summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2010-10-02 13:54:11 +0200
committermh <mh@immerda.ch>2010-10-02 13:54:11 +0200
commitb604693d32eed5d0172578b6db6d442a197bc373 (patch)
tree1683cfacca84e689d9bc6da24350af933284e5e8
parente4efcb0f74b43709c1f2905dcfd7026ec6753224 (diff)
allow also that submodules are initialized
-rw-r--r--manifests/clone.pp14
1 files changed, 13 insertions, 1 deletions
diff --git a/manifests/clone.pp b/manifests/clone.pp
index 0fe70c4..4025648 100644
--- a/manifests/clone.pp
+++ b/manifests/clone.pp
@@ -1,7 +1,11 @@
+# submodules: Whether we should initialize and update
+# submodules as well
+# Default: false
define git::clone(
$ensure = present,
$git_repo,
$projectroot,
+ $submodules = false,
$cloneddir_user='root',
$cloneddir_group='0',
$cloneddir_restrict_mode=true
@@ -15,11 +19,19 @@ define git::clone(
default: {
require ::git
exec {"git-clone_${name}":
- command => "git-clone --no-hardlinks ${git_repo} ${projectroot}",
+ command => "git clone --no-hardlinks ${git_repo} ${projectroot}",
creates => "${projectroot}/.git",
user => root,
notify => Exec["git-clone-chown_${name}"],
}
+ if $submodules {
+ exec{"git-submodules_${name}":
+ command => "git submodule init && git submodule update",
+ cwd => $projectroot,
+ refreshonly => true,
+ subscribe => Exec["git-clone_${name}"],
+ }
+ }
exec {"git-clone-chown_${name}":
command => "chown -R ${cloneddir_user}:${cloneddir_group} ${projectroot};chmod -R og-rwx ${projectroot}/.git",
refreshonly => true