Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first commit

  • Loading branch information...
commit ff1e3443eb97691261df91c034383f597729f9c1 0 parents
@ohadlevy ohadlevy authored ohadlevy committed
4 manifests/init.pp
@@ -0,0 +1,4 @@
+class git {
+ include git::params
+ include git::install
+}
3  manifests/install.pp
@@ -0,0 +1,3 @@
+class git::install {
+ package {$git::params::pkg: ensure => installed }
+}
7 manifests/params.pp
@@ -0,0 +1,7 @@
+class git::params {
+ $bin = '/usr/bin/git'
+ $pkg = $::operatingsystem ? {
+ /(Debian|Ubuntu)/ => ['git-core'],
+ default => ['git'],
+ }
+}
22 manifests/repo.pp
@@ -0,0 +1,22 @@
+define git::repo($target, $bare = false, $source = false, $user = 'root') {
+
+ if $source {
+ $cmd = "${git::params::bin} clone $source $target --recursive"
+ } else {
+ if $bare {
+ $cmd = "${git::params::bin} init --bare $target"
+ } else {
+ $cmd = "${git::params::bin} init $target"
+ }
+ }
+
+ exec { "git_repo_for_${name}":
+ command => $cmd,
+ creates => $bare ? {
+ true => "${target}/objects",
+ false => $target,
+ },
+ require => Class['git::install'],
+ user => $user
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.