Puppet Class: logstash::params
- Inherited by:
-
logstash
- Defined in:
- manifests/params.pp
Overview
Class: logstash::params
This class exists to
-
Declutter the default value assignment for class parameters.
-
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
Authors
-
Richard Pijnenburg <richard.pijnenburg@elasticsearch.com>
-
Matthias Baur <matthias.baur@dmc.de>
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 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'manifests/params.pp', line 31
class logstash::params {
#### Default values for the parameters of the main module class, init.pp
# ensure
$ensure = 'present'
# autoupgrade
$autoupgrade = false
# service status
$status = 'enabled'
# restart on configuration change?
$restart_on_change = true
# Purge configuration directory
$purge_configdir = false
$purge_package_dir = false
# package download timeout
$package_dl_timeout = 600 # 300 seconds is default of puppet
# default version to use if none is provided when manage_repo is set to true
$repo_version = '1.5'
#### Internal module values
# User and Group for the files and user to run the service as.
case $::kernel {
'Linux': {
$logstash_user = 'root'
$logstash_group = 'root'
}
'Darwin': {
$logstash_user = 'root'
$logstash_group = 'wheel'
}
default: {
fail("\"${module_name}\" provides no user/group default value
for \"${::kernel}\"")
}
}
# Download tool
case $::kernel {
'Linux': {
$download_tool = 'wget --no-check-certificate -O'
}
'Darwin': {
$download_tool = 'curl -o'
}
default: {
fail("\"${module_name}\" provides no download tool default value
for \"${::kernel}\"")
}
}
# Different path definitions
case $::kernel {
'Linux': {
$configdir = '/etc/logstash'
$package_dir = '/var/lib/logstash/swdl'
$installpath = '/opt/logstash'
$plugin = '/opt/logstash/bin/plugin'
}
'Darwin': {
$configdir = '/Library/Application Support/Logstash'
$package_dir = '/Library/Logstash/swdl'
$installpath = '/Library/Logstash'
$plugin = '/Library/Logstash/bin/plugin'
}
default: {
fail("\"${module_name}\" provides no config directory default value
for \"${::kernel}\"")
}
}
$patterndir = "${configdir}/patterns"
$plugindir = "${configdir}/plugins"
# packages
case $::operatingsystem {
'RedHat', 'CentOS', 'Fedora', 'Scientific', 'Amazon', 'OracleLinux', 'SLES', 'OpenSuSE': {
# main application
$package = [ 'logstash' ]
$package_name = 'logstash'
$contrib = [ 'logstash-contrib' ]
}
'Debian', 'Ubuntu': {
# main application
$package = [ 'logstash' ]
$package_name = 'logstash'
$contrib = [ 'logstash-contrib' ]
}
default: {
fail("\"${module_name}\" provides no package default value
for \"${::operatingsystem}\"")
}
}
# service parameters
case $::operatingsystem {
'RedHat', 'CentOS', 'Fedora', 'Scientific', 'Amazon', 'OracleLinux', 'SLES', 'OpenSuSE': {
$service_name = 'logstash'
$service_hasrestart = true
$service_hasstatus = true
$service_pattern = $service_name
$service_providers = [ 'init' ]
$defaults_location = '/etc/sysconfig'
}
'Debian', 'Ubuntu': {
$service_name = 'logstash'
$service_hasrestart = true
$service_hasstatus = true
$service_pattern = $service_name
$service_providers = [ 'init' ]
$defaults_location = '/etc/default'
}
'Darwin': {
$service_name = 'net.logstash'
$service_hasrestart = true
$service_hasstatus = true
$service_pattern = $service_name
$service_providers = [ 'launchd' ]
$defaults_location = false
}
default: {
fail("\"${module_name}\" provides no service parameters
for \"${::operatingsystem}\"")
}
}
}
|