From 6a807c5011907cd7e6e7f1eb63414666167fefd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Baufaker=20R=C3=AAgo?= Date: Mon, 9 Oct 2023 17:24:32 -0300 Subject: [PATCH] Add custom zookeeper id for each host based in inventory --- roles/amq_streams_zookeeper/README.md | 1 + roles/amq_streams_zookeeper/tasks/main.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/amq_streams_zookeeper/README.md b/roles/amq_streams_zookeeper/README.md index 51ac73a..cb1557b 100644 --- a/roles/amq_streams_zookeeper/README.md +++ b/roles/amq_streams_zookeeper/README.md @@ -35,6 +35,7 @@ zknode3 |`amq_streams_zookeeper_admin_enable_server` | Enable zookeeper administration server | `false` | |`amq_streams_zookeeper_instance_count_enabled` | Count zookeeper instances | `true` | |`amq_streams_zookeeper_instance_count` | | `0` | +|`amq_streams_zookeeper_zookeeper_id` | Zookeeper variable to identify the zookeeper in a cluster | | |`amq_streams_zookeeper_java_opts` | Default values to apply to `KAFKA_OPTS` env variable | | |`amq_streams_zookeeper_java_heap_opts` | Default values to apply to `KAFKA_HEAP_OPTS` env variable | `-Xmx512M -Xms512M` | |`amq_streams_zookeeper_java_performance_opts` | Default values to apply to `KAFKA_JVM_PERFORMANCE_OPTS` env variable | | diff --git a/roles/amq_streams_zookeeper/tasks/main.yml b/roles/amq_streams_zookeeper/tasks/main.yml index 52aad4f..23c3de7 100644 --- a/roles/amq_streams_zookeeper/tasks/main.yml +++ b/roles/amq_streams_zookeeper/tasks/main.yml @@ -37,7 +37,7 @@ - name: "Configure 'myid' file based on the position in the zookeepers group" copy: - content: "{{ amq_streams_zookeeper_inventory_group.index(inventory_hostname) + 1 }}" + content: "{{ amq_streams_zookeeper_zookeeper_id | default(amq_streams_zookeeper_inventory_group.index(inventory_hostname) + 1) }}" dest: "{{ amq_streams_zookeeper_data_dir }}/myid" owner: "{{ amq_streams_zookeeper_user | default(omit) }}" group: "{{ amq_streams_zookeeper_group | default(omit) }}"