forked from joshbeard/puppet-crowd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
params.pp
88 lines (79 loc) · 2.67 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
83
84
85
86
87
88
# Class crowd::params
#
class crowd::params {
case $::osfamily {
'Redhat': {
$shell = '/sbin/nologin'
if versioncmp($::operatingsystemmajrelease, '7') >= 0 {
$service_file = '/usr/lib/systemd/system/crowd.service'
$service_template = 'crowd/crowd.service.erb'
$service_mode = '0644'
$service_provider = 'systemd'
}
else {
$service_file = '/etc/init.d/crowd'
$service_template = 'crowd/crowd.init.erb'
$service_mode = '0755'
$service_provider = undef
}
}
'Debian': {
$shell = '/usr/sbin/nologin'
case $::operatingsystem {
'Ubuntu': {
if versioncmp($::operatingsystemmajrelease, '16') >= 0 {
$service_file = '/lib/systemd/system/crowd.service'
$service_template = 'crowd/crowd.service.erb'
$service_mode = '0644'
$service_provider = 'systemd'
}
else {
$service_file = '/etc/init.d/crowd'
$service_template = 'crowd/crowd.init.erb'
$service_mode = '0755'
$service_provider = undef
}
}
'Debian': {
if versioncmp($::operatingsystemmajrelease, '8') == 0 {
$service_file = '/lib/systemd/system/crowd.service'
$service_template = 'crowd/crowd.service.erb'
$service_mode = '0644'
$service_provider = 'systemd'
} elsif versioncmp($::operatingsystemmajrelease, '9') >= 0 {
$service_file = '/etc/systemd/system/crowd.service'
$service_template = 'crowd/crowd.service.erb'
$service_mode = '0644'
$service_provider = 'systemd'
}
else {
$service_file = '/etc/init.d/crowd'
$service_template = 'crowd/crowd.init.erb'
$service_mode = '0755'
$service_provider = undef
}
}
default: {
fail("The crowd module is not supported on ${::operatingsystem}")
}
}
}
'Windows': {
fail('Windows is not supported')
}
default: {
fail("The crowd 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 crowd stop && sleep 10'
}