Defined Type: logstash::configfile
- Defined in:
- manifests/configfile.pp
Overview
This type represents a Logstash pipeline configuration file.
Parameters are mutually exclusive. Only one should be specified.
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 |
# File 'manifests/configfile.pp', line 44
define logstash::configfile (
$content = undef,
$source = undef,
$template = undef,
$path = undef,
) {
include logstash
$owner = 'root'
$group = $logstash::logstash_group
$mode = '0640'
$require = Package['logstash'] # So that we have '/etc/logstash/conf.d'.
$tag = ['logstash_config'] # So that we notify the service.
if($template) { $config = template($template) }
elsif($content) { $config = $content }
else { $config = undef }
if($path) { $config_file = $path }
else { $config_file = "${logstash::config_dir}/conf.d/${name}" }
if($config) {
file { $config_file:
content => $config,
owner => $owner,
group => $group,
mode => $mode,
require => $require,
tag => $tag,
}
}
elsif($source) {
file { $config_file:
source => $source,
owner => $owner,
group => $group,
mode => $mode,
require => $require,
tag => $tag,
}
}
}
|