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
|
# File 'manifests/broker/config.pp', line 6
class kafka::broker::config (
Boolean $manage_service = $kafka::broker::manage_service,
String[1] $service_name = $kafka::broker::service_name,
Boolean $service_restart = $kafka::broker::service_restart,
Hash[String[1], Any] $config = $kafka::broker::config,
Stdlib::Absolutepath $config_dir = $kafka::broker::config_dir,
String[1] $user_name = $kafka::broker::user_name,
String[1] $group_name = $kafka::broker::group_name,
Stdlib::Filemode $config_mode = $kafka::broker::config_mode,
Boolean $manage_log4j = $kafka::broker::manage_log4j,
Pattern[/[1-9][0-9]*[KMG]B/] $log_file_size = $kafka::broker::log_file_size,
Integer[1, 50] $log_file_count = $kafka::broker::log_file_count,
) {
assert_private()
if ($manage_service and $service_restart) {
$config_notify = Service[$service_name]
} else {
$config_notify = undef
}
$doctag = 'brokerconfigs'
file { "${config_dir}/server.properties":
ensure => file,
owner => $user_name,
group => $group_name,
mode => $config_mode,
content => template('kafka/properties.erb'),
notify => $config_notify,
require => File[$config_dir],
}
if $manage_log4j {
file { "${config_dir}/log4j.properties":
ensure => file,
owner => $user_name,
group => $group_name,
mode => $config_mode,
content => epp('kafka/log4j.properties.epp', { 'log_file_size' => $log_file_size, 'log_file_count' => $log_file_count }),
notify => $config_notify,
require => File[$config_dir],
}
}
}
|