An Ansible Role that manages installation and configuration of Apache Kafka.
Kafka heavily depends on Apache ZooKeeper which is not part of this role - use nl2go.zookeeper to install it.
Available variables listed and described along with default values in defaults/main.yml.
- hosts: all
roles:
- nl2go.openjdk
- nl2go.kafka
vars:
kafka_zookeeper_connection_hosts:
- my.zookeeper.host:2181
For adjusting JVM parameters you use the kafka_environment_variables
variable to adjust the respective Kafka settings.
An overview of the variables used by Kafka can be found in the Kafka startup script.
Here is an example playbook:
- hosts: all
roles:
- nl2go.openjdk
- nl2go.kafka
vars:
kafka_environment_variables:
KAFKA_HEAP_OPTS="-Xmx192M"
For enabling monitoring via JMX you use the kafka_jmx_enabled
variable. Additionally you can enable JMX authentication
by setting kafka_jmx_username
and kafka_jmx_password
. If you leave the authentication variables undefined JMX will
be set up without authentication.
Here is an example playbook:
- hosts: all
roles:
- nl2go.openjdk
- nl2go.kafka
vars:
kafka_jmx_enabled: true
kafka_jmx_username: jmx
kafka_jmx_password: jmxpass
Use docker-molecule following the instructions to run Molecule or install Molecule locally (not recommended, version conflicts might appear).
Use following to run tests:
molecule test --all
See the LICENSE.md file for details.
This role was created in 2020 by Newsletter2Go GmbH.