Puppet Class: tempo::config

Defined in:
manifests/config.pp

Summary

A short summary of the purpose of this class

Overview



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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'manifests/config.pp', line 4

class tempo::config {
  $config_file = "${tempo::config_dir}/config.yaml"

  file { $tempo::config_dir:
    ensure => directory,
  }
  -> concat { $config_file:
    ensure => present,
  }

  if $::tempo::manage_service {
    Concat[$config_file] {
      notify => Service['tempo'],
    }
  }

  concat::fragment { 'tempo_config_header':
    target  => $config_file,
    content => "---\n",
    order   => '01',
  }

  # Enables authentication through the X-Scope-OrgID header, which must be present
  # if true. If false, the OrgID will always be set to "fake".
  # [auth_enabled: <boolean> | default = true]
  $_auth_enabled = $tempo::auth_enabled ? {
    undef          => true,
    default        => $tempo::auth_enabled,
  }
  concat::fragment { 'tempo_config_auth_enabled':
    target  => $config_file,
    content => "auth_enabled: ${_auth_enabled}\n",
    order   => '03',
  }

  # Configures the server of the launched module(s).
  # [server: <server_config>]
  if $tempo::server_config_hash {
    concat::fragment { 'tempo_server_config':
      target  => $config_file,
      content => $tempo::server_config_hash.promtail::to_yaml.promtail::strip_yaml_header,
      order   => '10',
    }
  }

  # Configures the compactor and how the compactor will register itself to a
  # key value store.
  # [compactor: <compactor_config>]
  if $tempo::compactor_config_hash {
    concat::fragment { 'tempo_compactor_config':
      target  => $config_file,
      content => $tempo::compactor_config_hash.promtail::to_yaml.promtail::strip_yaml_header,
      order   => '11',
    }
  }

  # Configures the distributor.
  # [distributor: <distributor_config>]
  if $tempo::distributor_config_hash {
    concat::fragment { 'tempo_distributor_config':
      target  => $config_file,
      content => $tempo::distributor_config_hash.promtail::to_yaml.promtail::strip_yaml_header,
      order   => '12',
    }
  }

  # Configures the ingester and how the ingester will register itself to a
  # key value store.
  # [ingester: <ingester_config>]
  if $tempo::ingester_config_hash {
    concat::fragment { 'tempo_ingester_config':
      target  => $config_file,
      content => $tempo::ingester_config_hash.promtail::to_yaml.promtail::strip_yaml_header,
      order   => '13',
    }
  }

  # Configures the memberlist and how the memberlist will register itself to a
  # key value store.
  # [memberlist: <memberlist_config>]
  if $tempo::memberlist_config_hash {
    concat::fragment { 'tempo_memberlist_config':
      target  => $config_file,
      content => $tempo::memberlist_config_hash.promtail::to_yaml.promtail::strip_yaml_header,
      order   => '14',
    }
  }

  # Configures the storage and how the storage will register itself to a
  # key value store.
  # [storage: <storage_config>]
  if $tempo::storage_config_hash {
    concat::fragment { 'tempo_storage_config':
      target  => $config_file,
      content => $tempo::storage_config_hash.promtail::to_yaml.promtail::strip_yaml_header,
      order   => '15',
    }
  }
}