Puppet Class: profile::mjolnir::kafka_bulk_daemon

Defined in:
modules/profile/manifests/mjolnir/kafka_bulk_daemon.pp

Overview

Parameters:

  • kafka_cluster (String) (defaults to: hiera('profile::mjolnir::kafka_bulk_daemon::kafka_cluster'))
  • group_id (String) (defaults to: hiera('profile::mjolnir::kafka_bulk_daemon::group_id'))
  • topics (Array[String]) (defaults to: hiera('profile::mjolnir::kafka_bulk_daemon::topics'))
  • prometheus_nodes (Array[String]) (defaults to: hiera('prometheus_nodes', []))


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'modules/profile/manifests/mjolnir/kafka_bulk_daemon.pp', line 12

class profile::mjolnir::kafka_bulk_daemon(
    String $kafka_cluster = hiera('profile::mjolnir::kafka_bulk_daemon::kafka_cluster'),
    String $group_id = hiera('profile::mjolnir::kafka_bulk_daemon::group_id'),
    Array[String] $topics = hiera('profile::mjolnir::kafka_bulk_daemon::topics'),
    Array[String] $prometheus_nodes = hiera('prometheus_nodes', []),
) {
    require ::profile::mjolnir

    $prometheus_port = 9170
    $kafka_config = kafka_config($kafka_cluster)
    ::systemd::service { 'mjolnir-kafka-bulk-daemon':
        content => template('profile/mjolnir/kafka-bulk-daemon.service.erb'),
    }

    ::base::service_auto_restart { 'mjolnir-kafka-bulk-daemon': }

    $prometheus_nodes_ferm = join($prometheus_nodes, ' ')
    ferm::service { 'mjolnir-bulk-metrics':
        proto  => 'tcp',
        port   => $prometheus_port,
        srange => "(@resolve((${prometheus_nodes_ferm})) @resolve((${prometheus_nodes_ferm}), AAAA))",
    }
}