From 129f2de0d3495ac6f6cc7b76a00bff8bfcd9c128 Mon Sep 17 00:00:00 2001 From: zane Date: Wed, 17 Jul 2013 20:32:26 -0700 Subject: Adding svn configuration parameter, and docs --- README.SVN.markdown | 15 +++++++++++++++ lib/puppet/provider/vcsrepo/svn.rb | 6 +++++- lib/puppet/type/vcsrepo.rb | 7 +++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/README.SVN.markdown b/README.SVN.markdown index 489f5bf..f374094 100644 --- a/README.SVN.markdown +++ b/README.SVN.markdown @@ -32,6 +32,21 @@ You can provide a specific `revision`: revision => '1234' } + +Using a specified Subversion configuration directory +----------------------------- + +Provide a `configuration` parameter which should be a directory path on the local system where your svn configuration +files are. Typically, it is /path/to/.subversion: + + vcsrepo { "/path/to/repo": + ensure => present, + provider => svn, + source => "svn://svnrepo/hello/branches/foo", + configuration => "/path/to/.subversion" + } + + For sources that use SSH (eg, `svn+ssh://...`) ---------------------------------------------- diff --git a/lib/puppet/provider/vcsrepo/svn.rb b/lib/puppet/provider/vcsrepo/svn.rb index 2dc0fd1..2e7cda5 100644 --- a/lib/puppet/provider/vcsrepo/svn.rb +++ b/lib/puppet/provider/vcsrepo/svn.rb @@ -6,7 +6,7 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo) optional_commands :svn => 'svn', :svnadmin => 'svnadmin' - has_features :filesystem_types, :reference_tracking, :basic_auth + has_features :filesystem_types, :reference_tracking, :basic_auth, :configuration def create if !@resource.value(:source) @@ -53,6 +53,10 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo) args.push('--force') end + if @resource.value(:configuration) + args.push('--config-dir', @resource.value(:configuration)) + end + return args end diff --git a/lib/puppet/type/vcsrepo.rb b/lib/puppet/type/vcsrepo.rb index 45ac455..fc20f75 100644 --- a/lib/puppet/type/vcsrepo.rb +++ b/lib/puppet/type/vcsrepo.rb @@ -30,6 +30,9 @@ Puppet::Type.newtype(:vcsrepo) do feature :multiple_remotes, "The repository tracks multiple remote repositories" + + feature :configuration, + "The configuration directory to use" ensurable do attr_accessor :latest @@ -176,5 +179,9 @@ Puppet::Type.newtype(:vcsrepo) do desc "The remote repository to track" defaultto "origin" end + + newparam :configuration, :required_features => [:configuration] do + desc "The configuration directory to use" + end end -- cgit v1.2.3