summaryrefslogtreecommitdiff
path: root/lib/puppet/type/vcsrepo.rb
diff options
context:
space:
mode:
authorroot <root@localhost.localdomain>2010-02-22 19:40:07 -0600
committerroot <root@localhost.localdomain>2010-02-22 19:40:07 -0600
commitcb2efcdfaa1f9b6d8c78208151d4b4ebd4e35885 (patch)
tree5d1cb21e799f002de8405a2b16d51f5632289cb9 /lib/puppet/type/vcsrepo.rb
Initial commit
Diffstat (limited to 'lib/puppet/type/vcsrepo.rb')
-rw-r--r--lib/puppet/type/vcsrepo.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/puppet/type/vcsrepo.rb b/lib/puppet/type/vcsrepo.rb
new file mode 100644
index 0000000..7db571e
--- /dev/null
+++ b/lib/puppet/type/vcsrepo.rb
@@ -0,0 +1,31 @@
+require 'pathname'
+
+Puppet::Type.newtype(:vcsrepo) do
+ desc "A local version control repository"
+
+ ensurable
+
+ newparam(:path) do
+ desc "Absolute path to repository"
+ isnamevar
+ validate do |value|
+ path = Pathname.new(value)
+ unless path.absolute?
+ raise ArgumentError, "Path must be absolute: #{path}"
+ end
+ end
+ end
+
+ newparam(:source) do
+ desc "The source URL for the repository"
+ validate do |value|
+ URI.parse(value)
+ end
+ end
+
+ newproperty(:revision) do
+ desc "The revision of the repository"
+ newvalue(/^\S+$/)
+ end
+
+end