Puppet Class: profile::mjolnir::kafka_bulk_daemon

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

Overview

Parameters:

  • kafka_cluster (String) (defaults to: lookup('profile::mjolnir::kafka_bulk_daemon::kafka_cluster'))
  • group_id (String) (defaults to: lookup('profile::mjolnir::kafka_bulk_daemon::group_id'))
  • es_cluster_endpoint (String) (defaults to: lookup('profile::mjolnir::kafka_bulk_daemon::es_cluster_endpoint', { 'default_value' => 'localhost:9200' }))
  • topics (Array[String]) (defaults to: lookup('profile::mjolnir::kafka_bulk_daemon::topics'))
  • priority_topics (Array[String]) (defaults to: lookup('profile::mjolnir::kafka_bulk_daemon::priority_topics'))
  • ensure (Wmflib::Ensure) (defaults to: lookup('profile::mjolnir::kafka_bulk_daemon::ensure', { 'default_value' => 'present' }))


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
# File 'modules/profile/manifests/mjolnir/kafka_bulk_daemon.pp', line 13

class profile::mjolnir::kafka_bulk_daemon(
    String $kafka_cluster = lookup('profile::mjolnir::kafka_bulk_daemon::kafka_cluster'),
    String $group_id = lookup('profile::mjolnir::kafka_bulk_daemon::group_id'),
    String $es_cluster_endpoint = lookup('profile::mjolnir::kafka_bulk_daemon::es_cluster_endpoint', { 'default_value' => 'localhost:9200' }),
    Array[String] $topics = lookup('profile::mjolnir::kafka_bulk_daemon::topics'),
    Array[String] $priority_topics = lookup('profile::mjolnir::kafka_bulk_daemon::priority_topics'),
    Wmflib::Ensure $ensure = lookup('profile::mjolnir::kafka_bulk_daemon::ensure', { 'default_value' => 'present' }),
) {
    require ::profile::mjolnir

    if empty($topics) and empty($priority_topics) {
        fail('you must provide either "topics" or "priority_topics"')
    }

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

    ::profile::auto_restarts::service { 'mjolnir-kafka-bulk-daemon':
        ensure => $ensure,
    }
}