Puppet Class: otelcol

Inherited by:
otelcol::config
Defined in:
manifests/init.pp

Overview

Parameters:

  • package_name (String) (defaults to: 'otelcol')

    Name of the package used

  • package_ensure (Enum['present','absent','installed','latest']) (defaults to: 'installed')

    Ensure for the package

  • service_name (String) (defaults to: $package_name)

    Name of the service used

  • environment_file (String) (defaults to: "/etc/${package_name}/${package_name}.conf")

    path of the environment file used for service

  • run_options (Optional[String]) (defaults to: undef)

    additional options for service

  • config_file (String) (defaults to: "/etc/${package_name}/config.yaml")

    path to config file

  • config_file_owner (String) (defaults to: 'root')

    owner of config_file

  • config_file_group (String) (defaults to: 'root')

    group of config_file

  • config_file_mode (Stdlib::Filemode) (defaults to: '0644')

    mode of config_file

  • receivers (Hash[String, Hash]) (defaults to: {})

    Hash for receivers config

  • processors (Hash[String, Hash]) (defaults to: {})

    Hash for processors config

  • exporters (Hash[String, Hash]) (defaults to: {})

    Hash for exporters config

  • pipelines (Hash[String, Hash]) (defaults to: {})

    Hash for pipelines config

  • extensions (Hash[String, Hash]) (defaults to: {})

    Hash for extensions config

  • log_options (Variant[Hash,String[1]]) (defaults to: {})

    Hash for log_options config

  • metrics_level (Enum['none','basic','normal','detailed']) (defaults to: 'basic')

    Level for metrics config

  • metrics_address_host (Optional[Stdlib::Host]) (defaults to: undef)

    Host metrics are listening to

  • metrics_address_port (Stdlib::Port) (defaults to: 8888)

    Port metrics are listening to

  • service_ensure (Stdlib::Ensure::Service) (defaults to: 'running')

    Ensure for service

  • manage_service (Boolean) (defaults to: true)

    If service is managed by module

  • manage_archive (Boolean) (defaults to: false)

    If archive should be managed by module of will be provided by packagemanager

  • localpath_archive (String[1]) (defaults to: '/tmp')

    Path where archive will be stored if managed

  • archive_version (String[1]) (defaults to: '0.89.0')

    Version of otelcol that will be used, param is not used if archive_location is set

  • archive_location (String[1]) (defaults to: "https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v${archive_version}/${package_name}_${archive_version}_linux_amd64")

    Path to archive without filetype extension



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'manifests/init.pp', line 51

class otelcol (
  String  $package_name                          = 'otelcol',
  Enum['present','absent','installed','latest']  $package_ensure       = 'installed',
  String  $service_name                          = $package_name,
  String  $environment_file                      = "/etc/${package_name}/${package_name}.conf",
  Optional[String]  $run_options                 = undef,
  String  $config_file                           = "/etc/${package_name}/config.yaml",
  String  $config_file_owner                     = 'root',
  String  $config_file_group                     = 'root',
  Stdlib::Filemode $config_file_mode             = '0644',
  Hash[String, Hash] $receivers = {},
  Hash[String, Hash] $processors = {},
  Hash[String, Hash] $exporters = {},
  Hash[String, Hash] $pipelines = {},
  Hash[String, Hash] $extensions = {},
  Variant[Hash,String[1]]    $log_options                            = {},
  Enum['none','basic','normal','detailed'] $metrics_level = 'basic',
  Optional[Stdlib::Host] $metrics_address_host    = undef,
  Stdlib::Port $metrics_address_port             = 8888,
  Stdlib::Ensure::Service $service_ensure       = 'running',
  Boolean $manage_service                        = true,
  Boolean $manage_archive                        = false,
  String[1] $localpath_archive                   = '/tmp',
  # Boolean $manage_user                           = false,
  String[1] $archive_version                     = '0.89.0',
  String[1] $archive_location          = "https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v${archive_version}/${package_name}_${archive_version}_linux_amd64",
) {
  contain otelcol::install
  contain otelcol::config

  if($manage_service) {
    contain otelcol::service
    Class['otelcol::config'] ~> Class['otelcol::service']
    Class['otelcol::install'] ~> Class['otelcol::service']
  }

  Class['otelcol::install'] -> Class['otelcol::config']
}