Puppet Class: kafka::broker
- Inherits:
- kafka::params
- Defined in:
- manifests/broker.pp
Overview
Class: kafka::broker
This class will install kafka with the broker role.
Requirements/Dependencies
Currently reequires the puppetlabs/stdlib module on the Puppet Forge in order to validate much of the the provided configuration.
Parameters
- version
-
The version of kafka that should be installed.
- scala_version
-
The scala version what kafka was built with.
- install_dir
-
The directory to install kafka to.
- mirror_url
-
The url where the kafka is downloaded from.
- config
-
A hash of the configuration options.
- install_java
-
Install java if it’s not already installed.
Examples
Create a single broker instance which talks to a local zookeeper instance.
class { ‘kafka::broker’:
config => { 'broker.id' => '0', 'zookeeper.connect' => 'localhost:2181' }
}
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'manifests/broker.pp', line 38
class kafka::broker (
$version = $kafka::params::version,
$scala_version = $kafka::params::scala_version,
$install_dir = $kafka::params::install_dir,
$mirror_url = $kafka::params::mirror_url,
$config = $kafka::params::broker_config_defaults,
$install_java = $kafka::params::install_java,
$package_dir = $kafka::params::package_dir
) inherits kafka::params {
validate_re($::osfamily, 'RedHat|Debian\b', "${::operatingsystem} not supported")
validate_re($version, '\d+\.\d+\.\d+\.*\d*', "${version} does not match semver")
validate_re($scala_version, '\d+\.\d+\.\d+\.*\d*', "${version} does not match semver")
validate_absolute_path($install_dir)
validate_re($mirror_url, '^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$', "${mirror_url} is not a valid url")
validate_hash($config)
validate_bool($install_java)
validate_absolute_path($package_dir)
class { 'kafka::broker::install': } ->
class { 'kafka::broker::config': } ~>
class { 'kafka::broker::service': } ->
Class['kafka::broker']
}
|