-
Notifications
You must be signed in to change notification settings - Fork 259
Expand file tree
/
Copy pathkafka.pp
More file actions
71 lines (69 loc) · 2.33 KB
/
kafka.pp
File metadata and controls
71 lines (69 loc) · 2.33 KB
1
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
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
# Class: datadog_agent::integrations::kafka
#
# This class will install the necessary configuration for the kafka integration
#
# Parameters:
# $host:
# The host kafka is running on. Defaults to 'localhost'
# $username
# Optionally specify username for connection
# $password
# Optionally specify password for connection
# $port
# The port kafka is running on. Defaults to 9999
# $name
# Name given to kafka instance
# $process_name_regex
# Instead of specifying a host, and port. The agent can connect using the attach api.
# $tools_jar_path
# Path to tools jar needs to be set when process_name_regex is set
# $java_bin_path
# Path to java binary, should be set if agent cant find your java executable
# $trust_store_path
# Path to the trust store, should be set if ssl is enabled
# $trust_store_password
# Password to the trust store
# $tags
# Optional array of tags
#
#
# Sample Usage:
#
# class { 'datadog_agent::integrations::kafka' :
# servers => [
# {
# 'host' => 'localhost',
# 'username' => 'kafka_username',
# 'password' => 'kafka_password',
# 'port' => '9999',
# 'name' => 'kafka_instance',
# 'process_name_regex' => '.*process_name.*',
# 'tools_jar_path' => '/usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar',
# 'java_bin_path' => '/path/to/java',
# 'trust_store_path' => '/path/to/trustStore.jks',
# 'trust_store_password' => 'password',
# 'tags' => ['env: test', 'sometag: someinfo'],
# },
# {
# 'host' => 'localhost',
# 'port' => '9999',
# 'tags' => [],
# },
# ]
# }
#
class datadog_agent::integrations::kafka(
$servers = [{'host' => 'localhost', 'port' => '9999'}]
) inherits datadog_agent::params {
include datadog_agent
validate_array($servers)
file { "${datadog_agent::params::conf_dir}/kafka.yaml":
ensure => file,
owner => $datadog_agent::params::dd_user,
group => $datadog_agent::params::dd_group,
mode => '0600',
content => template('datadog_agent/agent-conf.d/kafka.yaml.erb'),
require => Package[$datadog_agent::params::package_name],
notify => Service[$datadog_agent::params::service_name],
}
}