Puppet Class: kafka::producer::config

Defined in:
manifests/producer/config.pp

Summary

This class handles the Kafka (producer) config.

Overview

Parameters:

  • manage_service (Boolean) (defaults to: $kafka::producer::manage_service)
  • service_name (String[1]) (defaults to: $kafka::producer::service_name)
  • service_restart (Boolean) (defaults to: $kafka::producer::service_restart)
  • config (Hash[String[1], Any]) (defaults to: $kafka::producer::config)
  • config_dir (Stdlib::Absolutepath) (defaults to: $kafka::producer::config_dir)
  • user_name (String[1]) (defaults to: $kafka::producer::user_name)
  • group_name (String[1]) (defaults to: $kafka::producer::group_name)
  • config_mode (Stdlib::Filemode) (defaults to: $kafka::producer::config_mode)


4
5
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
# File 'manifests/producer/config.pp', line 4

class kafka::producer::config (
  Boolean $manage_service                   = $kafka::producer::manage_service,
  String[1] $service_name                   = $kafka::producer::service_name,
  Boolean $service_restart                  = $kafka::producer::service_restart,
  Hash[String[1], Any] $config              = $kafka::producer::config,
  Stdlib::Absolutepath $config_dir          = $kafka::producer::config_dir,
  String[1] $user_name                      = $kafka::producer::user_name,
  String[1] $group_name                     = $kafka::producer::group_name,
  Stdlib::Filemode $config_mode             = $kafka::producer::config_mode,
) {
  if ($manage_service and $service_restart) {
    $config_notify = Service[$service_name]
  } else {
    $config_notify = undef
  }

  $doctag = 'producerconfigs'
  file { "${config_dir}/producer.properties":
    ensure  => file,
    owner   => $user_name,
    group   => $group_name,
    mode    => $config_mode,
    content => template('kafka/properties.erb'),
    notify  => $config_notify,
    require => File[$config_dir],
  }
}