Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8395471
topic.pp
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
904 B
Subscribers
None
topic.pp
View Options
# Author:: Liam Bennett (mailto:lbennett@opentable.com)
# Copyright:: Copyright (c) 2013 OpenTable Inc
# License:: MIT
# == Define: kafka::topic
#
# This defined type is used to manage the creation of kafka topics.
#
define
kafka
::
topic
(
$ensure
=
''
,
$zookeeper
=
''
,
$replication_factor
=
1
,
$partitions
=
1
,
$bin_dir
=
'/opt/kafka/bin'
,
)
{
$_zookeeper
=
"--zookeeper ${zookeeper}"
$_replication_factor
=
"--replication-factor ${replication_factor}"
$_partitions
=
"--partitions ${partitions}"
if
$ensure
==
'present'
{
exec
{
"create topic ${name}"
:
path
=>
"/usr/bin:/usr/sbin/:/bin:/sbin:${bin_dir}"
,
command
=>
"kafka-topics.sh --create ${_zookeeper} ${_replication_factor} ${_partitions} --topic ${name}"
,
unless
=>
"kafka-topics.sh --list ${_zookeeper} | grep -x ${name}"
,
}
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Jun 4 2025, 7:39 PM (10 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3399304
Attached To
R143 puppet-puppet-kafka
Event Timeline
Log In to Comment