This repository has been archived by the owner on Nov 18, 2020. It is now read-only.
forked from croomes/puppet-bamboo
-
Notifications
You must be signed in to change notification settings - Fork 10
/
service.pp
61 lines (55 loc) · 1.73 KB
/
service.pp
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
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
class bamboo::service (
$version = $bamboo::version,
$appdir = $bamboo::real_appdir,
$user = $bamboo::user,
$group = $bamboo::group,
$shell = $bamboo::shell,
$java_home = $bamboo::java_home,
$manage_service = $bamboo::manage_service,
$service_ensure = $bamboo::service_ensure,
$service_enable = $bamboo::service_enable,
$service_file = $bamboo::service_file,
$service_template = $bamboo::service_template,
$service_provider = $bamboo::service_provider,
$shutdown_wait = $bamboo::shutdown_wait,
$initconfig_manage = $bamboo::initconfig_manage,
$initconfig_path = $bamboo::initconfig_path,
$initconfig_content = $bamboo::initconfig_content,
$umask = $bamboo::umask,
) {
if $initconfig_manage {
file { $initconfig_path:
ensure => 'file',
content => $initconfig_content,
owner => 'root',
group => 'root',
mode => '0640',
}
if $manage_service {
File[$initconfig_path] ~> Service['bamboo']
}
}
file { $service_file:
ensure => 'file',
owner => 'root',
group => 'root',
mode => '0755',
content => template($service_template),
}
if $manage_service {
if $service_provider == 'systemd' {
exec { 'bamboo-refresh_systemd':
command => 'systemctl daemon-reload',
refreshonly => true,
path => '/bin:/sbin:/usr/bin:/usr/sbin',
subscribe => File[$service_file],
before => Service['bamboo'],
}
}
service { 'bamboo':
ensure => $service_ensure,
enable => $service_enable,
subscribe => File[$service_file],
}
}
}