13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
79
80
|
# File 'manifests/rptsdk.pp', line 13
class daq::rptsdk (
Stdlib::HTTPUrl $repo_url = 'https://repo-nexus.lsst.org/nexus/repository/daq/rpt-sdk',
String $version = 'V3.5.3',
Boolean $purge = false,
) {
require daq
$base_path = "${daq::base_path}/rpt-sdk"
$dl_path = "${base_path}/dl"
$archive_name = "rce-sdk-${version}.tar.gz"
$dl_file = "${dl_path}/${archive_name}"
$source = "${repo_url}/${archive_name}"
$install_path = "${base_path}/${version}"
$current_path = "${base_path}/current"
# Purge unmanaged versions. Currently, only one version may be installed at
# a time. The $dl_path file resource should protect previously downloaded
# artifacts from being purged.
file { $base_path:
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
force => $purge,
purge => $purge,
recurse => $purge,
max_files => 10000,
}
file { $dl_path:
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
}
archive { $dl_file:
ensure => present,
cleanup => false,
creates => $install_path,
extract_path => $base_path,
extract => true,
source => $source,
require => File[$base_path],
}
~> file { $dl_file:
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
}
# chown untar dir
file { $install_path:
owner => 'root',
group => 'root',
recurse => true,
max_files => 10000,
require => Archive[$dl_file],
}
file { $current_path:
ensure => link,
owner => 'root',
group => 'root',
target => $version,
}
}
|