Skip to content

An Ansible Role that manages installation and configuration of Apache Kafka

License

Notifications You must be signed in to change notification settings

nl2go/ansible-role-kafka

Repository files navigation

Build Status Ansible Galaxy Ansible Galaxy Quality Score GitHub tag (latest by date) Ansible Galaxy Downloads

Ansible Role: Apache Kafka

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.

Role Variables

Available variables listed and described along with default values in defaults/main.yml.

Dependencies

Example Playbook

- hosts: all
  roles:
    - nl2go.openjdk
    - nl2go.kafka
  vars:
    kafka_zookeeper_connection_hosts:
      - my.zookeeper.host:2181

Set up custom JVM parameters

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"

Set up monitoring for Kafka

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

Development

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

Maintainers

License

See the LICENSE.md file for details.

Author Information

This role was created in 2020 by Newsletter2Go GmbH.