Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: modules/logstash/manifests/fragment.pp

Issue 29327588: Issue 2864 - Introduce class logstash (Closed)
Patch Set: Created Sept. 14, 2015, 7:23 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # == Type: logstash::fragment
2 #
3 # Manage Logstash (https://logstash.net/) configuration file fragments.
4 #
5 # === Parameters:
6 #
7 # [*content*]
8 # The configuration as-is, mutually exclusive with $source.
9 #
10 # [*ensure*]
11 # Either 'present' or 'absent'.
12 #
13 # [*order*]
14 # Any index for lexical odering of fragments within the generated file.
15 #
16 # [*source*]
17 # The configuration source location, mutually exclusive with $content.
18 #
19 # [*target*]
20 # The name or resource of the target pipeline configuration.
21 #
22 # === Examples:
23 #
24 # logstash::fragment {'input':
25 # content => template('custom/pipeline-inputs.erb'),
26 # order => 20,
27 # target => Logstash::Pipeline['custom'],
28 # }
29 #
30 # logstash::fragment {'filter':
31 # content => template('custom/pipeline-filters.erb'),
32 # order => 40,
33 # target => Logstash::Pipeline['custom'],
34 # }
35 #
36 # logstash::fragment {'output':
37 # content => template('custom/pipeline-outputs.erb'),
38 # order => 60,
39 # target => Logstash::Pipeline['custom'],
40 # }
41 #
42 define logstash::fragment(
43 $content = undef,
44 $ensure = 'present',
45 $order = 10,
46 $source = undef,
47 $target = 'default',
48 ) {
49
50 if is_string($target) {
51 $pipeline = Logstash::Pipeline[$target]
52 }
53 else {
54 $pipeline = $target
55 }
56
57 $pipeline_title = getparam($pipeline, 'title')
58 $pipeline_id = "logstash::pipeline#$pipeline_title"
59
60 concat::fragment {"logstash::fragment#$title":
61 content => $content,
62 ensure => $ensure,
63 order => $order,
64 source => $source,
65 target => $pipeline_id,
66 }
67 }
OLDNEW

Powered by Google App Engine
This is Rietveld