31
32
33
34
35
36
37
38
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
70
71
72
73
74
75
76
77
78
|
# File 'manifests/client/install.pp', line 31
class minio::client::install(
Enum['present', 'absent'] $package_ensure = $minio::client::package_ensure,
Stdlib::HTTPUrl $base_url = $minio::client::base_url,
String $version = $minio::client::version,
String $checksum = $minio::client::checksum,
String $checksum_type = $minio::client::checksum_type,
Stdlib::Absolutepath $installation_directory = $minio::client::installation_directory,
String $binary_name = $minio::client::binary_name,
) {
$kernel_down = downcase($::kernel)
case $::architecture {
/(x86_64)/: {
$arch = 'amd64'
}
/(x86)/: {
fail('Minio client does not support x86 architecture')
}
default: {
$arch = $::architecture
}
}
$source_url = "${base_url}/${kernel_down}-${arch}/archive/mc.${version}"
$target = "${installation_directory}/${binary_name}"
$link_ensure = $package_ensure ? {
'present' => 'link',
'absent' => 'absent'
}
archive::download { $target:
ensure => $package_ensure,
checksum => true,
digest_string => $checksum,
digest_type => $checksum_type,
url => $source_url,
}
-> file { $target:
ensure => $package_ensure,
mode => '0755',
owner => 'root',
group => 'root',
}
-> file { '/root/.minioclient':
ensure => $link_ensure,
target => $target,
}
}
|