Page MenuHomeSoftware Heritage

topic.pp
No OneTemporary

topic.pp

# 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

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

Event Timeline