Puppet Class: profile::elasticsearch::toolforge

Defined in:
modules/profile/manifests/elasticsearch/toolforge.pp

Overview

Class: profile::elasticsearch::toolforge

Provisions Elasticsearch node with nginx reverse proxy

filtertags: labs-project-tools

Parameters:

  • prometheus_nodes (Array[Stdlib::Fqdn]) (defaults to: lookup('prometheus_nodes'))
  • elastic_settings (Elasticsearch::InstanceParams) (defaults to: lookup('profile::elasticsearch::common_settings'))


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
# File 'modules/profile/manifests/elasticsearch/toolforge.pp', line 6

class profile::elasticsearch::toolforge (
    Array[Stdlib::Fqdn] $prometheus_nodes = lookup('prometheus_nodes'),
    Elasticsearch::InstanceParams $elastic_settings = lookup('profile::elasticsearch::common_settings'),
){
    include ::profile::elasticsearch

    file { '/usr/share/elasticsearch/plugins':
        ensure => 'directory',
        force  => true,
        owner  => 'root',
        group  => 'root',
        mode   => '0755',
        before => Class['::elasticsearch'],
    }

    prometheus::elasticsearch_exporter { "localhost:${elastic_settings['http_port']}":
        prometheus_port    => 9108,
        elasticsearch_port => $elastic_settings['http_port'],
    }

    $prometheus_hosts = join($prometheus_nodes, ' ')
    # So prometheus blackbox exporter can monitor ssh
    ferm::service { 'ssh-prometheus':
        proto  => 'tcp',
        port   => '22',
        srange => "@resolve((${prometheus_hosts}))",
    }

    ferm::service { 'prometheus_elasticsearch_exporter_9108':
        proto  => 'tcp',
        port   => 9108,
        srange => "@resolve((${prometheus_hosts}))",
    }

}