K Jonathan Harker 8c66da99df Add kibana3 support
Add support for the javascript version of kibana.

By default, this is done by serving both the kibana and also an
elasticsearch proxy from the same location. Allowed GETs and POSTs
for read-only access to elasticsearch are passed to a proxy and all
other requests are served from the kibana source directory.

An optional prefix, such as 'elasticsearch/', can be specified in which
case the reverse proxy to elasticsearch will be served from this
sub-path.

Change-Id: I13f9dff0bbd6498a36dc75b026c9042a9bb05e8f
2015-10-14 12:18:31 -07:00

68 lines
1.9 KiB
Puppet

# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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 to install kibana frontend to logstash.
#
class kibana (
$discover_nodes = ['localhost:9200'],
$version = 'ruby',
$js_vhost_name = $::fqdn,
$js_vhost_aliases = [],
$js_vhost_template = 'kibana/dual-elasticsearch.vhost.erb',
$js_elasticsearch_prefix = '/',
$js_elasticsearch_url = 'http://localhost:9200',
) {
group { 'kibana':
ensure => present,
}
user { 'kibana':
ensure => present,
comment => 'Kibana User',
home => '/opt/kibana',
gid => 'kibana',
shell => '/bin/bash',
membership => 'minimum',
require => Group['kibana'],
}
file { '/opt/kibana':
ensure => directory,
owner => 'kibana',
group => 'kibana',
mode => '0644',
recurse => true,
require => User['kibana'],
}
case $version {
'ruby': {
include ::kibana::ruby
}
'js': {
class { '::kibana::js':
vhost_name => $js_vhost_name,
vhost_aliases => $js_vhost_aliases,
vhost_template => $js_vhost_template,
elasticsearch_prefix => $js_elasticsearch_prefix,
elasticsearch_url => $js_elasticsearch_url,
}
}
default: {
fail("Unknown version: ${version}")
}
}
}