39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# File 'manifests/download.pp', line 39
define archive::download (
String $url,
Array $headers = [],
Boolean $allow_insecure = false,
Boolean $checksum = true,
Enum['none', 'md5', 'sha1', 'sha2','sha256', 'sha384', 'sha512'] $digest_type = 'md5', # bad default!
Enum['present', 'absent'] $ensure = 'present',
Stdlib::Absolutepath $src_target = '/usr/src',
Optional[String] $digest_string = undef,
Optional[String] $digest_url = undef,
Optional[String] $proxy_server = undef,
Optional[String] $user = undef,
) {
$target = ($title =~ Stdlib::Absolutepath) ? {
false => "${src_target}/${title}",
default => $title,
}
archive { $target:
ensure => $ensure,
source => $url,
checksum_verify => $checksum,
checksum => $digest_string,
checksum_type => $digest_type,
checksum_url => $digest_url,
proxy_server => $proxy_server,
user => $user,
headers => $headers,
allow_insecure => $allow_insecure,
}
}
|