blob: 7db571e2c08b765bcc07a89bf42da6ae1ac556a1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
|