forked from DanielRedOak/puppet-logstashforwarder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparams.pp
94 lines (81 loc) · 2.06 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
89
90
91
92
93
94
# == Class: lumberjack::params
#
# This class exists to
# 1. Declutter the default value assignment for class parameters.
# 2. Manage internally used module variables in a central place.
#
# Therefore, many operating system dependent differences (names, paths, ...)
# are addressed in here.
#
#
# === Parameters
#
# This class does not provide any parameters.
#
#
# === Examples
#
# This class is not intended to be used directly.
#
#
# === Links
#
# * {Puppet Docs: Using Parameterized Classes}[http://j.mp/nVpyWY]
#
#
# === Authors
#
# * Richard Pijnenburg <mailto:[email protected]>
# Editor: Ryan O'Keeffe
class lumberjack::params {
#### Default values for the parameters of the main module class, init.pp
# ensure
$ensure = 'present'
# autoupgrade
$autoupgrade = false
# service status
$status = 'enabled'
# Config Directory
$configdir = '/etc/lumberjack'
# Config File
$config = 'lumberjack.conf'
# Install Directory
$installdir = '/opt/lumberjack'
# Restart service on change
$restart_on_change = false
#### Internal module values
# packages
case $::operatingsystem {
'CentOS', 'Fedora', 'Scientific', 'OracleLinux', 'Amazon', 'RedHat', 'OEL': {
# main application
$package = [ 'lumberjack' ]
}
'Debian', 'Ubuntu': {
# main application
$package = [ 'lumberjack' ]
}
default: {
fail("\"${module_name}\" provides no package default value
for \"${::operatingsystem}\"")
}
}
# service parameters
case $::operatingsystem {
'CentOS', 'Fedora', 'Scientific', 'OracleLinux', 'Amazon', 'RedHat', 'OEL': {
$service_name = 'lumberjack'
$service_hasrestart = true
$service_hasstatus = true
$service_pattern = $service_name
}
'Debian', 'Ubuntu': {
$service_name = 'lumberjack'
$service_hasrestart = true
$service_hasstatus = true
$service_pattern = $service_name
}
default: {
fail("\"${module_name}\" provides no service parameters
for \"${::operatingsystem}\"")
}
}
}