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

Delta Between Two Patch Sets: modules/logstash/manifests/init.pp

Issue 29327588: Issue 2864 - Introduce class logstash (Closed)
Left Patch Set: Created Sept. 14, 2015, 7:23 a.m.
Right Patch Set: Issue 2864 - Address feedback from code-review Created Oct. 20, 2015, 1:04 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « modules/logstash/manifests/fragment.pp ('k') | modules/logstash/manifests/pipeline.pp » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 # == Class: logstash 1 # == Class: logstash
2 # 2 #
3 # Manage Logstash (https://logstash.net/) installations via APT. 3 # Manage Logstash (https://logstash.net/) installations via APT.
4 # 4 #
5 # Please refer to the online documentation at Elastic for more information 5 # Please refer to the online documentation at Elastic for more information
6 # on the logstash software, it's usage and configuration options: 6 # on the logstash software, it's usage and configuration options:
7 # 7 #
8 # https://www.elastic.co/guide/en/logstash/current/index.html 8 # https://www.elastic.co/guide/en/logstash/current/index.html
9 # 9 #
10 # === Parameters: 10 # === Parameters:
11 # 11 #
12 # [*contrib*] 12 # [*contrib*]
13 # Whether to realize Package['logstash-contrib']. 13 # Whether to realize Package['logstash-contrib'].
14 # 14 #
15 # [*ensure*] 15 # [*ensure*]
16 # Either 'present'/'stopped', 'running'/'started', or 'absent'/'purged'. 16 # Either 'present'/'stopped', 'running'/'started', or 'absent'/'purged'.
17 # Note that Service['logstash'] is only realized implicitly when $ensure 17 # Note that Service['logstash'] is only realized implicitly when $ensure
18 # is neither 'absent' nor 'purged'. 18 # is neither 'absent' nor 'purged'.
19 # 19 #
20 # [*pipelines*] 20 # [*pipelines*]
21 # A hash to setup logstash::pipeline {$name: $parameter} resources. 21 # A hash to setup logstash::pipeline {$name: $parameter} resources.
22 # 22 #
23 # [*version*] 23 # [*version*]
24 # The http://packages.elasticsearch.org/logstash/%s/debian $version. 24 # The https://packages.elasticsearch.org/logstash/%s/debian $version.
25 # 25 #
26 # === Examples: 26 # === Examples:
27 # 27 #
28 # class {'logstash': 28 # class {'logstash':
29 # contrib => true, 29 # contrib => true,
30 # pipelines => { 30 # pipelines => {
31 # 'example' => { 31 # 'example' => {
32 # # see type logstash::pipeline for a parameter reference 32 # # see type logstash::pipeline for a parameter reference
33 # }, 33 # },
34 # }, 34 # },
(...skipping 13 matching lines...) Expand all
48 48
49 apt::key {'logstash': 49 apt::key {'logstash':
50 ensure => $ensure_file, 50 ensure => $ensure_file,
51 key => 'D88E42B4', 51 key => 'D88E42B4',
52 key_content => template('logstash/elastic-logstash-gpg-key.erb'), 52 key_content => template('logstash/elastic-logstash-gpg-key.erb'),
53 } 53 }
54 54
55 apt::source {'logstash': 55 apt::source {'logstash':
56 ensure => $ensure_file, 56 ensure => $ensure_file,
57 include_src => false, 57 include_src => false,
58 location => "http://packages.elasticsearch.org/logstash/$version/debian", 58 location => "https://packages.elasticsearch.org/logstash/$version/debian",
Felix Dahlke 2015/10/07 10:46:32 Can we use HTTPS?
mathias 2015/10/20 13:03:33 Yes we can.
59 release => 'stable', 59 release => 'stable',
60 require => Apt::Key['logstash'], 60 require => Apt::Key['logstash'],
61 } 61 }
62 62
63 package {'logstash': 63 package {'logstash':
64 ensure => $ensure ? { 64 ensure => $ensure ? {
65 /^(absent|purged)$/ => $ensure, 65 /^(absent|purged)$/ => $ensure,
66 default => 'present', 66 default => 'present',
67 }, 67 },
68 require => Apt::Source['logstash'], 68 require => Apt::Source['logstash'],
(...skipping 14 matching lines...) Expand all
83 default => true, 83 default => true,
84 }, 84 },
85 ensure => $ensure ? { 85 ensure => $ensure ? {
86 /^(running|started)$/ => 'running', 86 /^(running|started)$/ => 'running',
87 default => 'stopped', 87 default => 'stopped',
88 }, 88 },
89 hasrestart => true, 89 hasrestart => true,
90 require => Package['logstash'], 90 require => Package['logstash'],
91 } 91 }
92 92
93 file {'/usr/local/bin/logstash': 93 file {'/usr/local/bin/logstash':
Felix Dahlke 2015/10/07 10:46:32 Would a symlink do? If not: AFAIK it's a sort of
mathias 2015/10/20 13:03:33 No, a symbolic link won't do. The /opt/logstash/bi
Felix Dahlke 2015/10/30 09:43:10 Acknowledged.
94 ensure => $ensure_file, 94 ensure => $ensure_file,
95 mode => 0755, 95 mode => 0755,
96 source => 'puppet:///modules/logstash/logstash.sh', 96 source => 'puppet:///modules/logstash/logstash.sh',
97 require => Package['logstash'], 97 require => Package['logstash'],
98 } 98 }
99 99
100 if $contrib { 100 if $contrib {
101 realize(Package['logstash-contrib']) 101 realize(Package['logstash-contrib'])
102 } 102 }
103 103
104 if $ensure !~ /^(absent|purged)$/ { 104 if $ensure !~ /^(absent|purged)$/ {
105 realize(Service['logstash']) 105 realize(Service['logstash'])
106 } 106 }
107 107
108 create_resources('logstash::pipeline', $pipelines) 108 create_resources('logstash::pipeline', $pipelines)
109 } 109 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld