diff options
author | mh <mh@immerda.ch> | 2010-10-02 13:47:55 +0200 |
---|---|---|
committer | mh <mh@immerda.ch> | 2010-10-02 13:47:55 +0200 |
commit | e4efcb0f74b43709c1f2905dcfd7026ec6753224 (patch) | |
tree | 6bc440fa6c0e29bb97843ed40485a174a9c20525 | |
parent | 3f0a69fc232f7ea10c61d3a661bb7e529efb74fe (diff) |
require root git class, rather than include and require specific parts of it
-rw-r--r-- | manifests/clone.pp | 63 |
1 files changed, 31 insertions, 32 deletions
diff --git a/manifests/clone.pp b/manifests/clone.pp index 1d6a298..0fe70c4 100644 --- a/manifests/clone.pp +++ b/manifests/clone.pp @@ -1,37 +1,36 @@ define git::clone( - $ensure = present, - $git_repo, - $projectroot, - $cloneddir_user='root', - $cloneddir_group='0', - $cloneddir_restrict_mode=true + $ensure = present, + $git_repo, + $projectroot, + $cloneddir_user='root', + $cloneddir_group='0', + $cloneddir_restrict_mode=true ){ - case $ensure { - absent: { - exec{"rm -rf $projectroot": - onlyif => "test -d $projectroot", - } - } - default: { - include git - exec {"git-clone_${name}": - command => "git-clone --no-hardlinks ${git_repo} ${projectroot}", - creates => "${projectroot}/.git", - user => root, - require => Package['git'], - notify => Exec["git-clone-chown_${name}"], - } - exec {"git-clone-chown_${name}": - command => "chown -R ${cloneddir_user}:${cloneddir_group} ${projectroot};chmod -R og-rwx ${projectroot}/.git", - refreshonly => true - } - if $cloneddir_restrict_mode { - exec {"git-clone-chmod_${name}": - command => "chmod -R o-rwx ${projectroot}", - refreshonly => true, - subscribe => Exec["git-clone_${name}"], - } - } + case $ensure { + absent: { + exec{"rm -rf $projectroot": + onlyif => "test -d $projectroot", + } + } + default: { + require ::git + exec {"git-clone_${name}": + command => "git-clone --no-hardlinks ${git_repo} ${projectroot}", + creates => "${projectroot}/.git", + user => root, + notify => Exec["git-clone-chown_${name}"], + } + exec {"git-clone-chown_${name}": + command => "chown -R ${cloneddir_user}:${cloneddir_group} ${projectroot};chmod -R og-rwx ${projectroot}/.git", + refreshonly => true + } + if $cloneddir_restrict_mode { + exec {"git-clone-chmod_${name}": + command => "chmod -R o-rwx ${projectroot}", + refreshonly => true, + subscribe => Exec["git-clone_${name}"], } + } } + } } |