diff options
Diffstat (limited to 'lib/puppet/type')
-rw-r--r-- | lib/puppet/type/vcsrepo.rb | 31 |
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 |