Puppet Class: mediawiki::logging::yaml_defs

Defined in:
modules/mediawiki/manifests/logging/yaml_defs.pp

Overview

Parameters:

  • path (Stdlib::Unixpath)
  • kafka_brokers (Array[String])
  • udp2log (String)
  • ca_cert_path (String) (defaults to: '/etc/ssl/certs/wmf-ca-certificates.crt')


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'modules/mediawiki/manifests/logging/yaml_defs.pp', line 1

class mediawiki::logging::yaml_defs(
    Stdlib::Unixpath $path,
    Array[String] $kafka_brokers,
    String $udp2log,
    String $ca_cert_path = '/etc/ssl/certs/wmf-ca-certificates.crt',
) {
    $kb = $kafka_brokers.map |$broker| { {'host' => $broker, 'port' => 9093}}
    $logging_data = {
        'kafka_brokers' => $kb,
        'rsyslog' => true,
        'udp2log_hostport' => $udp2log,
        'ca_cert_path' => $ca_cert_path,
    }
    file { $path:
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        content => to_yaml({'mw' => {'logging' => $logging_data}})
    }
}