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
/
params.pp
82 lines (73 loc) · 2.61 KB
/
params.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
class bamboo::params {
case $::osfamily {
'RedHat': {
$initconfig_path = '/etc/sysconfig/bamboo'
if $::operatingsystemmajrelease == '7' {
$service_file = '/usr/lib/systemd/system/bamboo.service'
$service_template = 'bamboo/bamboo.service.erb'
$service_provider = 'systemd'
}
elsif $::operatingsystemmajrelease == '6' or $::operatingsystem == 'Amazon'{
$service_file = '/etc/init.d/bamboo'
$service_template = 'bamboo/bamboo.init.erb'
$service_provider = undef
}
else {
fail("${::osfamily} ${::operatingsystemmajrelease} not supported.")
}
}
'Debian': {
$initconfig_path = '/etc/default/bamboo'
case $::operatingsystem {
'Ubuntu': {
if versioncmp($::operatingsystemmajrelease, '16') >= 0 {
$service_file = '/lib/systemd/system/bamboo.service'
$service_template = 'bamboo/bamboo.service.erb'
$service_provider = 'systemd'
}
else {
$service_file = '/etc/init.d/bamboo'
$service_template = 'bamboo/bamboo.init.erb'
$service_provider = undef
}
}
'Debian': {
if versioncmp($::operatingsystemmajrelease, '8') == 0 {
$service_file = '/lib/systemd/system/bamboo.service'
$service_template = 'bamboo/bamboo.service.erb'
$service_provider = 'systemd'
} elsif versioncmp($::operatingsystemmajrelease, '9') >= 0 {
$service_file = '/etc/systemd/system/bamboo.service'
$service_template = 'bamboo/bamboo.service.erb'
$service_provider = 'systemd'
}
else {
$service_file = '/etc/init.d/bamboo'
$service_template = 'bamboo/bamboo.init.erb'
$service_provider = undef
}
}
default: {
fail("The bamboo module is not supported on ${::operatingsystem}")
}
}
}
'Windows': {
fail('The bamboo module is not supported on Windows')
}
default: {
fail("The bamboo module is not supported on ${::osfamily}")
}
}
# Where to stick the external fact for reporting the version
# Refer to:
# https://docs.puppet.com/facter/3.5/custom_facts.html#fact-locations
# https://github.com/puppetlabs/facter/commit/4bcd6c87cf00609f28be23f6463a3d76d0b6613c
if versioncmp($::facterversion, '2.4.2') >= 0 {
$facter_dir = '/opt/puppetlabs/facter/facts.d'
}
else {
$facter_dir = '/etc/puppetlabs/facter/facts.d'
}
$stop_command = 'service bamboo stop && sleep 10'
}