Puppet Class: profile::benthos

Defined in:
modules/profile/manifests/benthos.pp

Overview

SPDX-License-Identifier: Apache-2.0

Class: profile::benthos

Deploy self-contained Benthos instances and configurations, together with base package etc..

Parameters:

  • instances (Hash[String, Any]) (defaults to: lookup('profile::benthos::instances'))
  • use_geoip (Boolean) (defaults to: lookup('profile::benthos::use_geoip', { 'default_value' => false} ))


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

class profile::benthos(
    Hash[String, Any] $instances = lookup('profile::benthos::instances'),
    Boolean $use_geoip = lookup('profile::benthos::use_geoip', { 'default_value' => false} ),
) {
    class { 'benthos': }

    if $use_geoip {
        class { 'geoip': }
    }

    $instances.each | $instance, $instance_config | {
        $kafka = kafka_config($instance_config['kafka']['cluster'], $instance_config['kafka']['site'])
        # Setting up base environment variables
        $base_env_variables = {
            port          => $instance_config['port'],
            kafka_brokers => $kafka['brokers']['ssl_string'],
            kafka_topics  => join($instance_config['kafka']['topics'], ',')
        }
        $custom_env_variables = $instance_config['env_variables'] ? {
            undef   => {},
            default => $instance_config['env_variables'],
        }
        benthos::instance { $instance:
            ensure        => $instance_config['ensure'],
            env_variables => $base_env_variables + $custom_env_variables,
            config_source => "profile/benthos/instances/${instance}.yaml",
            port          => $instance_config['port'],
        }
    }
}