Emilien Macchi e22400fb45 logging: enable HTTP CORS for fluentd ES instance
Elasticsearch package has been upgrade to 1.4.x in J.1.1.0 and J.1.2.0
(1.0.3 in J.1.0.0) but kibana web interface is not compatible with
elasticsearch 1.4.x or higher if you don't change the configuration on
the service.

Change-Id: I19c1a0b08aa63ca0fad6b1a2c390e13775efa443
Closes-bug: #1451828
2015-05-05 23:36:07 -04:00

66 lines
2.0 KiB
Puppet

#
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# == Class: cloud::logging::server
#
# [*kibana_port*]
# (optional) Port of Kibana service.
# Defaults to '8300'
#
# [*kibana_bind_ip*]
# (optional) Address on which kibana is listening on
# Defaults to '127.0.0.1'
#
# [*firewall_settings*]
# (optional) Allow to add custom parameters to firewall rules
# Should be an hash.
# Default to {}
#
class cloud::logging::server(
$kibana_port = '8300',
$kibana_bind_ip = '127.0.0.1',
$firewall_settings = {},
) {
Class['cloud::database::nosql::elasticsearch'] -> Class['kibana3']
Class['cloud::database::nosql::elasticsearch'] -> Class['cloud::logging::agent']
include ::kibana3
include cloud::database::nosql::elasticsearch
include cloud::logging::agent
# Elasticsearch 1.4 ships with a security setting that prevents Kibana from connecting.
# We need to allow http cors in fluentd instance.
elasticsearch::instance {'fluentd' :
config => { 'http' => { 'cors.enabled' => true } }
}
@@haproxy::balancermember{"${::fqdn}-kibana":
listening_service => 'kibana',
server_names => $::hostname,
ipaddresses => $kibana_bind_ip,
ports => $kibana_port,
options => 'check inter 2000 rise 2 fall 5'
}
if $::cloud::manage_firewall {
cloud::firewall::rule{ '100 allow kibana access':
port => $kibana_port,
extras => $firewall_settings,
}
}
}