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
|
# File 'modules/thanos/manifests/query.pp', line 12
class thanos::query (
Stdlib::Port::Unprivileged $http_port,
String $replica_label = 'replica',
String $sd_files = '/etc/thanos-query/stores/*.yml',
Boolean $request_debug = false,
) {
ensure_packages(['thanos'])
$http_address = "0.0.0.0:${http_port}"
$service_name = 'thanos-query'
$sd_files_path = dirname($sd_files)
file { ['/etc/thanos-query', $sd_files_path]:
ensure => directory,
mode => '0555',
owner => 'root',
group => 'root',
}
$logging_config = @("CONFIG")
http:
options:
level: DEBUG
decision:
log_start: true
log_end: true
| CONFIG
file { '/etc/thanos-query/request-logging.yml':
ensure => present,
content => $logging_config,
}
$logging_cmdline = $request_debug ? {
true => '--log.level=debug --request.logging-config-file=/etc/thanos-query/request-logging.yml',
default => '',
}
systemd::service { $service_name:
ensure => present,
restart => true,
override => true,
content => systemd_template('thanos-query'),
service_params => {
enable => true,
hasrestart => true,
},
}
}
|