Skip to content

Commit

Permalink
Merge pull request #33 from sleighzy/simonl/add-config-params-to-serv…
Browse files Browse the repository at this point in the history
…er-properties

Add support for providing additional configuration params
  • Loading branch information
sleighzy authored Aug 13, 2023
2 parents c2f8575 + 1763bdb commit cd28070
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 44 deletions.
89 changes: 45 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ elastically scaled with no downtime.

This Ansible role does not handle the migration process of upgrading from older
versions of Kafka. Please ensure that you read the upgrade documentation and
update the revelant configuration files before running this role.
update the relevant configuration files before running this role.

<https://kafka.apache.org/35/documentation.html#upgrade>

Expand Down Expand Up @@ -56,49 +56,50 @@ See <https://github.com/ansible/ansible/issues/71528> for more information.

## Role Variables

| Variable | Default |
| ---------------------------------------------- | ------------------------------------ |
| kafka_download_base_url | <https://downloads.apache.org/kafka> |
| kafka_download_validate_certs | yes |
| kafka_version | 3.5.1 |
| kafka_scala_version | 2.13 |
| kafka_create_user_group | true |
| kafka_user | kafka |
| kafka_group | kafka |
| kafka_root_dir | /opt |
| kafka_dir | {{ kafka_root_dir }}/kafka |
| kafka_start | yes |
| kafka_restart | yes |
| kafka_log_dir | /var/log/kafka |
| kafka_broker_id | 0 |
| kafka_java_heap | -Xms1G -Xmx1G |
| kafka_background_threads | 10 |
| kafka_listeners | PLAINTEXT://:9092 |
| kafka_num_network_threads | 3 |
| kafka_num_io_threads | 8 |
| kafka_num_replica_fetchers | 1 |
| kafka_socket_send_buffer_bytes | 102400 |
| kafka_socket_receive_buffer_bytes | 102400 |
| kafka_socket_request_max_bytes | 104857600 |
| kafka_replica_socket_receive_buffer_bytes | 65536 |
| kafka_data_log_dirs | /var/lib/kafka/logs |
| kafka_num_partitions | 1 |
| kafka_num_recovery_threads_per_data_dir | 1 |
| kafka_log_cleaner_threads | 1 |
| kafka_offsets_topic_replication_factor | 1 |
| kafka_transaction_state_log_replication_factor | 1 |
| kafka_transaction_state_log_min_isr | 1 |
| kafka_log_retention_hours | 168 |
| kafka_log_segment_bytes | 1073741824 |
| kafka_log_retention_check_interval_ms | 300000 |
| kafka_auto_create_topics_enable | false |
| kafka_delete_topic_enable | true |
| kafka_default_replication_factor | 1 |
| kafka_group_initial_rebalance_delay_ms | 0 |
| kafka_zookeeper_connect | localhost:2181 |
| kafka_zookeeper_connection_timeout | 6000 |
| kafka_bootstrap_servers | localhost:9092 |
| kafka_consumer_group_id | kafka-consumer-group |
| Variable | Default | Comments |
| ---------------------------------------------- | ------------------------------------ | ---------------------------------------------------------------- |
| kafka_download_base_url | <https://downloads.apache.org/kafka> | |
| kafka_download_validate_certs | yes | |
| kafka_version | 3.5.1 | |
| kafka_scala_version | 2.13 | |
| kafka_create_user_group | true | |
| kafka_user | kafka | |
| kafka_group | kafka | |
| kafka_root_dir | /opt | |
| kafka_dir | {{ kafka_root_dir }}/kafka | |
| kafka_start | yes | |
| kafka_restart | yes | |
| kafka_log_dir | /var/log/kafka | |
| kafka_broker_id | 0 | |
| kafka_java_heap | -Xms1G -Xmx1G | |
| kafka_background_threads | 10 | |
| kafka_listeners | PLAINTEXT://:9092 | |
| kafka_num_network_threads | 3 | |
| kafka_num_io_threads | 8 | |
| kafka_num_replica_fetchers | 1 | |
| kafka_socket_send_buffer_bytes | 102400 | |
| kafka_socket_receive_buffer_bytes | 102400 | |
| kafka_socket_request_max_bytes | 104857600 | |
| kafka_replica_socket_receive_buffer_bytes | 65536 | |
| kafka_data_log_dirs | /var/lib/kafka/logs | |
| kafka_num_partitions | 1 | |
| kafka_num_recovery_threads_per_data_dir | 1 | |
| kafka_log_cleaner_threads | 1 | |
| kafka_offsets_topic_replication_factor | 1 | |
| kafka_transaction_state_log_replication_factor | 1 | |
| kafka_transaction_state_log_min_isr | 1 | |
| kafka_log_retention_hours | 168 | |
| kafka_log_segment_bytes | 1073741824 | |
| kafka_log_retention_check_interval_ms | 300000 | |
| kafka_auto_create_topics_enable | false | |
| kafka_delete_topic_enable | true | |
| kafka_default_replication_factor | 1 | |
| kafka_group_initial_rebalance_delay_ms | 0 | |
| kafka_zookeeper_connect | localhost:2181 | |
| kafka_zookeeper_connection_timeout | 6000 | |
| kafka_bootstrap_servers | localhost:9092 | |
| kafka_consumer_group_id | kafka-consumer-group | |
| kafka_server_config_params | | General dictionary that will be templated into server.properties |

See [log4j.yml](./defaults/main/002-log4j.yml) for detailed
log4j-related available variables.
Expand Down
4 changes: 4 additions & 0 deletions templates/server.properties.j2
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,7 @@ ssl.keystore.password={{ kafka_ssl.keystore_password }}
ssl.key.password={{ kafka_ssl.key_password }}
ssl.client.auth={{ kafka_ssl.client_auth }}
{% endif %}

{% for key, value in (kafka_server_config_params | default({})).items() %}
{{key}}={{value}}
{% endfor %}

0 comments on commit cd28070

Please sign in to comment.