Skip to content

Instantly share code, notes, and snippets.

@limed
Created November 18, 2011 21:05
Show Gist options
  • Save limed/1377758 to your computer and use it in GitHub Desktop.
Save limed/1377758 to your computer and use it in GitHub Desktop.
create an svn repo
define subversion::repo($path = "") {
Exec { path => "/bin:/sbin:/usr/bin:/usr/sbin" }
if $path == "" {
file { "create_svndir":
ensure => directory,
path => "/opt/svn",
owner => root,
group => root,
mode => '0755',
}
}
case $path {
"": {
exec { "create_repo_${name}":
command => "svnadmin create /opt/svn/${name}",
unless => "test -d /opt/svn/${name}"
}
}
default: {
exec { "create_repo_${name}":
command => "svnadmin create ${path}/${name}",
unless => "test -d ${path}/${name}",
}
}
}
}
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment