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
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
|
# File 'manifests/install.pp', line 3
class jetty::install inherits jetty {
$_jetty_home = "${jetty::root}/jetty"
$_jetty_tmp = "${_jetty_home}/tmp"
$_jetty_logs = "${_jetty_home}/logs"
$_jetty_sh = "${_jetty_home}/bin/jetty.sh"
$_download_directory = "jetty-distribution-${jetty::version}"
$_download_file_name = "${_download_directory}.${jetty::archive_type}"
$_tmp_download_file_name = "/tmp/${_download_file_name}"
$_download_url = "${jetty::mirror}/org/eclipse/jetty/jetty-distribution/${jetty::version}/${_download_file_name}"
$_download_url_checksum = "${_download_url}.${jetty::checksum_type}"
include '::archive'
if $jetty::manage_user {
ensure_resource('group', $::jetty::group, {
ensure => present,
})
ensure_resource('user', $::jetty::user, {
shell => '/bin/false',
system => false,
home => $_jetty_tmp,
gid => $::jetty::group,
})
}
File {
owner => $::jetty::user,
group => $::jetty::group,
mode => '0774',
}
file { $_jetty_home:
ensure => link,
target => "${::jetty::root}/${_download_directory}",
} ->
file { "${::jetty::root}/${_download_directory}":
ensure => directory,
} ->
archive { $_tmp_download_file_name:
ensure => present,
source => $_download_url,
checksum_url => $_download_url_checksum,
checksum_verify => true,
allow_insecure => true,
extract => true,
extract_path => $::jetty::root,
cleanup => true,
creates => "${::jetty::root}/jetty-installed",
user => $::jetty::user,
group => $::jetty::group,
require => User[$::jetty::user],
}
file { '/etc/init.d/jetty':
ensure => link,
target => $_jetty_sh,
owner => 'root',
group => 'root',
mode => '0750',
} ->
file { '/var/log/jetty':
ensure => link,
target => $_jetty_logs,
} ->
file { $_jetty_tmp:
ensure => directory,
}
}
|