Puppet Class: kibana

Defined in:
puppet/modules/kibana/manifests/init.pp

Overview

Class: kibana

Kibana is a JavaScript web application for visualizing log data and other types of time-stamped data. It integrates with ElasticSearch and LogStash.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'puppet/modules/kibana/manifests/init.pp', line 6

class kibana {
    require ::elasticsearch::repository

    package { 'kibana-oss':
        ensure => latest,
    }

    npm::global { 'elasticdump': }

    file { '/etc/kibana/kibana.yml':
        ensure  => file,
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        content => ordered_yaml({
            'kibana.defaultAppId' => 'dashboard/default',
            'logging.quiet'       => true,
            'server.host'         => '0.0.0.0',
        }),
        require => Package['kibana-oss']
    }

    service { 'kibana':
        ensure  => running,
        enable  => true,
        require => [
            Package['kibana-oss'],
            File['/etc/kibana/kibana.yml'],
        ],
    }

    exec { 'import-kibana-index-mapping':
        command     => 'elasticdump --input=/vagrant/puppet/modules/kibana/files/kibana-mapping.json --output=http://127.0.0.1:9200/.kibana_1 --type=mapping',
        refreshonly => true,
        subscribe   => Service['kibana'],
        require     => [
            Exec['wait-for-elasticsearch'],
            Npm::Global['elasticdump'],
        ],
    }

    exec { 'import-kibana-index-data':
        command     => 'elasticdump --input=/vagrant/puppet/modules/kibana/files/kibana-data.json --output=http://127.0.0.1:9200/.kibana_1 --type=data',
        refreshonly => true,
        subscribe   => Exec['import-kibana-index-mapping'],
        require     => [
            Exec['wait-for-elasticsearch'],
            Npm::Global['elasticdump'],
        ],
    }
}