Puppet Class: profile::rsyslog::kubernetes

Defined in:
modules/profile/manifests/rsyslog/kubernetes.pp

Overview

Parameters:

  • enable (Boolean) (defaults to: lookup( 'profile::rsyslog::kubernetes::enable', {'default_value' => false}))
  • token (Optional[String]) (defaults to: lookup( 'profile::rsyslog::kubernetes::token', {'default_value' => undef}))
  • kubernetes_url (Optional[Stdlib::HTTPSUrl]) (defaults to: lookup( 'profile::rsyslog::kubernetes::kubernetes_url', {'default_value' => undef}))


2
3
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
31
32
# File 'modules/profile/manifests/rsyslog/kubernetes.pp', line 2

class profile::rsyslog::kubernetes (
    Boolean $enable = lookup(
        'profile::rsyslog::kubernetes::enable', {'default_value' => false}),
    Optional[String] $token = lookup(
        'profile::rsyslog::kubernetes::token', {'default_value' => undef}),
    Optional[Stdlib::HTTPSUrl] $kubernetes_url = lookup(
        'profile::rsyslog::kubernetes::kubernetes_url', {'default_value' => undef}),
) {
    include profile::rsyslog::shellbox

    if debian::codename::eq('buster') {
        apt::package_from_component { 'rsyslog_kubernetes':
            component => 'component/rsyslog-k8s',
            packages  => ['rsyslog-kubernetes'],
        }
    } else {
        ensure_packages('rsyslog-kubernetes')
    }

    $ensure = $enable ? {
      true    => present,
      default => absent,
    }

    rsyslog::conf { 'kubernetes':
        ensure   => $ensure,
        content  => template('profile/rsyslog/kubernetes.conf.erb'),
        priority => 9,
        mode     => '0400', # Contains sensitive token
    }
}