Merge "Use MQTT output plugin on logstash workers"

This commit is contained in:
Jenkins 2016-09-21 10:28:05 +00:00 committed by Gerrit Code Review
commit 5b40817662
3 changed files with 27 additions and 3 deletions

View File

@ -460,6 +460,9 @@ node /^logstash-worker\d+\.openstack\.org$/ {
class { 'openstack_project::logstash_worker':
discover_node => 'elasticsearch02.openstack.org',
enable_mqtt => true,
mqtt_password => hiera('mqtt_service_user_password'),
mqtt_ca_cert_contents => hiera('mosquitto_tls_ca_file'),
}
}

View File

@ -18,6 +18,13 @@ class openstack_project::logstash_worker (
$discover_node = 'elasticsearch01.openstack.org',
$filter_rev = 'master',
$filter_source = 'https://git.openstack.org/openstack-infra/logstash-filters',
$enable_mqtt = false,
$mqtt_hostname = 'firehose.openstack.org',
$mqtt_port = 8883,
$mqtt_topic = "logstash/${::hostname}",
$mqtt_username = 'infra',
$mqtt_password = undef,
$mqtt_ca_cert_contents = undef,
) {
file { '/etc/default/logstash-indexer':
ensure => present,
@ -47,9 +54,11 @@ class openstack_project::logstash_worker (
}
class { '::logstash::indexer':
input_template => 'openstack_project/logstash/input.conf.erb',
output_template => 'openstack_project/logstash/output.conf.erb',
require => Logstash::Filter['openstack-logstash-filters'],
input_template => 'openstack_project/logstash/input.conf.erb',
output_template => 'openstack_project/logstash/output.conf.erb',
enable_mqtt => $enable_mqtt,
mqtt_ca_cert_contents => $mqtt_ca_cert_contents,
require => Logstash::Filter['openstack-logstash-filters'],
}
include ::log_processor

View File

@ -4,4 +4,16 @@ output {
manage_template => false
flush_size => 1024
}
<% if @enable_mqtt -%>
mqtt {
host => <%= @mqtt_hostname %>
port => <%= @mqtt_port %>
topic => <%= @mqtt_topic %>
username => <%= @mqtt_username %>
password => <%= @mqtt_password %>
ssl => true
ca_file => "/etc/logstash/mqtt-root-CA.crt"
}
<% end -%>
}