forked from DanielRedOak/puppet-logstashforwarder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.pp
57 lines (47 loc) · 1.14 KB
/
package.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
# == Class: lumberjack::package
#
# This class exists to coordinate all software package management related
# actions, functionality and logical units in a central place.
#
#
# === Parameters
#
# This class does not provide any parameters.
#
#
# === Examples
#
# This class may be imported by other classes to use its functionality:
# class { 'lumberjack::package': }
#
# It is not intended to be used directly by external resources like node
# definitions or other modules.
#
#
# === Authors
#
# * Richard Pijnenburg <mailto:[email protected]>
#
class lumberjack::package {
#### Package management
# set params: in operation
if ($lumberjack::ensure == 'present') {
# Check if we want to install a specific version or not
if $lumberjack::version == false {
$package_ensure = $lumberjack::autoupgrade ? {
true => 'latest',
false => 'present',
}
} else {
# install specific version
$package_ensure = $lumberjack::version
}
# set params: removal
} else {
$package_ensure = 'absent'
}
# action
package { $lumberjack::params::package :
ensure => $package_ensure,
}
}