Permalink
Browse files

Converting from bzr to git

  • Loading branch information...
0 parents commit 0a8bd7d93c4bda4f4ebd53bb39381f1744e1fe19 @lak committed Aug 17, 2007
Showing with 45 additions and 0 deletions.
  1. +9 −0 manifests/svnrepo.pp
  2. +36 −0 manifests/svnserve.pp
@@ -0,0 +1,9 @@
+# Create a new subversion repository.
+define svnrepo($path) {
+ exec { "create-svn-$name":
+ command => "/usr/bin/svnadmin create $path/$name",
+ creates => "$path/$name"
+ }
+}
+
+# $Id: svnrepo.pp 191 2006-08-30 06:08:09Z luke $
@@ -0,0 +1,36 @@
+# Serve subversion-based code from a local location. The job of this
+# module is to check the data out from subversion and keep it up to
+# date, especially useful for providing data to your Puppet server.
+#
+# Example usage:
+# svnserve { dist:
+# source => "https://reductivelabs.com/svn",
+# path => "/dist",
+# user => "puppet",
+# password => "mypassword"
+# }
+define svnserve($source, $path, $user = false, $password = false) {
+ file { $path:
+ ensure => directory,
+ owner => root,
+ group => root
+ }
+ $svncmd = $user ? {
+ false => "/usr/bin/svn co --non-interactive $source/$name .",
+ default => "/usr/bin/svn co --non-interactive --username $user --password '$password' $source/$name ."
+ }
+ exec { "svnco-$name":
+ command => $svncmd,
+ cwd => $path,
+ require => File[$path],
+ creates => "$path/.svn"
+ }
+ exec { "svnupdate-$name":
+ command => "/usr/bin/svn update",
+ require => Exec["svnco-$name"],
+ onlyif => '/usr/bin/svn status -u --non-interactive | /bin/grep "\*"',
+ cwd => $path
+ }
+}
+
+# $Id: svnserve.pp 202 2007-02-12 04:17:02Z luke $

0 comments on commit 0a8bd7d

Please sign in to comment.