summaryrefslogtreecommitdiff
path: root/lib/puppet/type
diff options
context:
space:
mode:
authorJesusaurus <jesusaurus@inbox.com>2012-05-12 20:42:05 -0700
committerJesusaurus <jesusaurus@inbox.com>2012-05-13 01:55:47 -0700
commitdce22cfd2d2f4c237df597cf6206d5c0d1aebc65 (patch)
treeb8e05b35c9ff8110db5fbbae7d5cb7d5070f2276 /lib/puppet/type
parent462b1d69bbc5d6c171dcee02a3d88d304acd630e (diff)
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.
Diffstat (limited to 'lib/puppet/type')
-rw-r--r--lib/puppet/type/vcsrepo.rb25
1 files changed, 17 insertions, 8 deletions
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