summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/init.pp18
-rw-r--r--manifests/js.pp54
2 files changed, 70 insertions, 2 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index af9c008..23f1d7f 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -15,8 +15,13 @@
15# Class to install kibana frontend to logstash. 15# Class to install kibana frontend to logstash.
16# 16#
17class kibana ( 17class kibana (
18 $discover_nodes = ['localhost:9200'], 18 $discover_nodes = ['localhost:9200'],
19 $version = 'ruby', 19 $version = 'ruby',
20 $js_vhost_name = $::fqdn,
21 $js_vhost_aliases = [],
22 $js_vhost_template = 'kibana/dual-elasticsearch.vhost.erb',
23 $js_elasticsearch_prefix = '/',
24 $js_elasticsearch_url = 'http://localhost:9200',
20) { 25) {
21 26
22 group { 'kibana': 27 group { 'kibana':
@@ -46,6 +51,15 @@ class kibana (
46 'ruby': { 51 'ruby': {
47 include ::kibana::ruby 52 include ::kibana::ruby
48 } 53 }
54 'js': {
55 class { '::kibana::js':
56 vhost_name => $js_vhost_name,
57 vhost_aliases => $js_vhost_aliases,
58 vhost_template => $js_vhost_template,
59 elasticsearch_prefix => $js_elasticsearch_prefix,
60 elasticsearch_url => $js_elasticsearch_url,
61 }
62 }
49 default: { 63 default: {
50 fail("Unknown version: ${version}") 64 fail("Unknown version: ${version}")
51 } 65 }
diff --git a/manifests/js.pp b/manifests/js.pp
new file mode 100644
index 0000000..646db02
--- /dev/null
+++ b/manifests/js.pp
@@ -0,0 +1,54 @@
1# Copyright 2015 Hewlett-Packard Development Company, L.P.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14#
15# Class to install kibana frontend to logstash.
16#
17class kibana::js (
18 $vhost_template = 'kibana/dual-elasticsearch.vhost.erb',
19 $vhost_aliases = [],
20 $vhost_name = $::fqdn,
21 $vhost_proxy_timeout = '120',
22 $vhost_proxy_connect_timeout = '15',
23 $elasticsearch_url = 'http://localhost:9200',
24 $elasticsearch_prefix = '/', # Must contain trailing /
25 $git_revision = 'v3.1.2',
26) {
27
28 $base_path = "/opt/kibana/${git_revision}"
29
30 vcsrepo { $base_path:
31 ensure => latest,
32 provider => 'git',
33 source => 'https://github.com/elasticsearch/kibana.git',
34 revision => $git_revision,
35 owner => 'www-data',
36 }
37
38 file { "${base_path}/src/config.js":
39 ensure => present,
40 content => template('kibana/config.js.erb'),
41 owner => 'www-data',
42 require => Vcsrepo[$base_path],
43 subscribe => Vcsrepo[$base_path],
44 }
45
46 apache::vhost { 'kibana':
47 docroot => "${base_path}/src",
48 vhost_name => $vhost_name,
49 serveraliases => $vhost_aliases,
50 port => 80,
51 template => $vhost_template,
52 }
53
54}