From dce22cfd2d2f4c237df597cf6206d5c0d1aebc65 Mon Sep 17 00:00:00 2001 From: Jesusaurus Date: Sat, 12 May 2012 20:42:05 -0700 Subject: Add the ability to specify a git remote Rather than fill the git provider with hard-coded references to origin, it would be better to abstract out which remote the resource is fetching from. But since this is only relevant to decentralized version-control systems, a multiple_remotes feature was added for the parameter to depend on. So far this is only implemented for git remotes, but it could be implemented for other VCSs as well. --- lib/puppet/type/vcsrepo.rb | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'lib/puppet/type/vcsrepo.rb') diff --git a/lib/puppet/type/vcsrepo.rb b/lib/puppet/type/vcsrepo.rb index 9824726..e291066 100644 --- a/lib/puppet/type/vcsrepo.rb +++ b/lib/puppet/type/vcsrepo.rb @@ -25,6 +25,9 @@ Puppet::Type.newtype(:vcsrepo) do feature :modules, "The repository contains modules that can be chosen of" + feature :multiple_remotes, + "The repository tracks multiple remote repositories" + ensurable do attr_accessor :latest @@ -89,7 +92,7 @@ Puppet::Type.newtype(:vcsrepo) do end - newparam(:path) do + newparam :path do desc "Absolute path to repository" isnamevar validate do |value| @@ -100,32 +103,32 @@ Puppet::Type.newtype(:vcsrepo) do end end - newparam(:source) do + newparam :source do desc "The source URI for the repository" end - newparam(:fstype, :required_features => [:filesystem_types]) do + newparam :fstype, :required_features => [:filesystem_types] do desc "Filesystem type" end - newproperty(:revision) do + newproperty :revision do desc "The revision of the repository" newvalue(/^\S+$/) end - newparam(:owner) do + newparam :owner do desc "The user/uid that owns the repository files" end - newparam(:group) do + newparam :group do desc "The group/gid that owns the repository files" end - newparam(:excludes) do + newparam :excludes do desc "Files to be excluded from the repository" end - newparam(:force) do + newparam :force do desc "Force repository creation, destroying any files on the path in the process." newvalues(:true, :false) defaultto false @@ -155,4 +158,10 @@ Puppet::Type.newtype(:vcsrepo) do newparam :module, :required_features => [:modules] do desc "The repository module to manage" end + + newparam :remote, :required_features => [:multiple_remotes] do + desc "The remote repository to track" + defaultto "origin" + end + end -- cgit v1.2.3