diff --git a/README.md b/README.md index 86d1904..a7e99bf 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://github.com/ansible-middleware/amq_streams/workflows/CI/badge.svg)](https://github.com/ansible-middleware/amq_streams/actions/workflows/ci.yml) -Collection to install and configure [Apache Kafka](https://kafka.apache.org/) / [Red Hat AMQ Streams](https://access.redhat.com/documentation/en-us/red_hat_amq_streams). +Collection to install and configure [Apache Kafka](https://kafka.apache.org/) / [Red Hat Streams for Apache Kafka](https://access.redhat.com/documentation/en-us/red_hat_amq_streams). ## Ansible version compatibility @@ -88,7 +88,7 @@ It is possible to perform downloads from alternate sources (like corporate Nexus described by the `amq_streams_common_archive_file` variable (ie. *kafka_-a.b.c-x.y.z.tgz*). -For Red Hat customers, this collection is released as a [Technology Preview](https://access.redhat.com/support/offerings/techpreview) feature as the [Red Hat Ansible certified content collection for AMQ Streams](https://console.redhat.com/ansible/automation-hub/repo/published/redhat/amq_streams). If you have any issues or questions related to this collection, please contact or open an issue at https://github.com/ansible-middleware/amq_streams/issues. +For Red Hat customers, this collection is released as a [Technology Preview](https://access.redhat.com/support/offerings/techpreview) feature as the [Red Hat Ansible certified content collection for Red Hat Streams for Apache Kafka](https://console.redhat.com/ansible/automation-hub/repo/published/redhat/amq_streams). If you have any issues or questions related to this collection, please contact or open an issue at https://github.com/ansible-middleware/amq_streams/issues. ## License diff --git a/amq_results.txt b/amq_results.txt new file mode 100644 index 0000000..14257f8 Binary files /dev/null and b/amq_results.txt differ diff --git a/roles/amq_streams_connect/templates/connect-standalone.properties.j2 b/roles/amq_streams_connect/templates/connect-standalone.properties.j2 index 72cc131..0da7569 100644 --- a/roles/amq_streams_connect/templates/connect-standalone.properties.j2 +++ b/roles/amq_streams_connect/templates/connect-standalone.properties.j2 @@ -46,36 +46,36 @@ producer.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModul # Consumer consumer.sasl.mechanism=PLAIN consumer.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="{{ amq_streams_connect_broker_auth_username }}" password="{{ amq_streams_connect_broker_auth_password }}"; -{% elif amq_streams_connect_broker_admin_mechanism == "SCRAM-SHA-512" %} +{% elif redhat_streams_connect_broker_admin_mechanism == "SCRAM-SHA-512" %} # SCRAM Login Module sasl.mechanism=SCRAM-SHA-512 -sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="{{ amq_streams_connect_broker_auth_username }}" password="{{ amq_streams_connect_broker_auth_password }}"; +sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="{{ redhat_streams_connect_broker_auth_username }}" password="{{ redhat_streams_connect_broker_auth_password }}"; # Producer producer.sasl.mechanism=SCRAM-SHA-512 -producer.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="{{ amq_streams_connect_broker_auth_username }}" password="{{ amq_streams_connect_broker_auth_password }}"; +producer.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="{{ redhat_streams_connect_broker_auth_username }}" password="{{ redhat_streams_connect_broker_auth_password }}"; # Consumer consumer.sasl.mechanism=SCRAM-SHA-512 -consumer.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="{{ amq_streams_connect_broker_auth_username }}" password="{{ amq_streams_connect_broker_auth_password }}"; +consumer.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="{{ redhat_streams_connect_broker_auth_username }}" password="{{ redhat_streams_connect_broker_auth_password }}"; {% endif %} {% endif %} -{% if amq_streams_connect_broker_tls_enabled %} -ssl.truststore.location={{ amq_streams_connect_broker_tls_truststore_client_location }}/{{ amq_streams_connect_broker_tls_truststore_client }} -ssl.truststore.password={{ amq_streams_connect_broker_tls_truststore_client_password }} +{% if redhat_streams_connect_broker_tls_enabled %} +ssl.truststore.location={{ redhat_streams_connect_broker_tls_truststore_client_location }}/{{ redhat_streams_connect_broker_tls_truststore_client }} +ssl.truststore.password={{ redhat_streams_connect_broker_tls_truststore_client_password }} # Disable hostname verification ssl.endpoint.identification.algorithm= # Producer -producer.ssl.truststore.location={{ amq_streams_connect_broker_tls_truststore_client_location }}/{{ amq_streams_connect_broker_tls_truststore_client }} -producer.ssl.truststore.password={{ amq_streams_connect_broker_tls_truststore_client_password }} +producer.ssl.truststore.location={{ redhat_streams_connect_broker_tls_truststore_client_location }}/{{ redhat_streams_connect_broker_tls_truststore_client }} +producer.ssl.truststore.password={{ redhat_streams_connect_broker_tls_truststore_client_password }} # Disable hostname verification producer.ssl.endpoint.identification.algorithm= # Consumer -consumer.ssl.truststore.location={{ amq_streams_connect_broker_tls_truststore_client_location }}/{{ amq_streams_connect_broker_tls_truststore_client }} -consumer.ssl.truststore.password={{ amq_streams_connect_broker_tls_truststore_client_password }} +consumer.ssl.truststore.location={{ redhat_streams_connect_broker_tls_truststore_client_location }}/{{ redhat_streams_connect_broker_tls_truststore_client }} +consumer.ssl.truststore.password={{ redhat_streams_connect_broker_tls_truststore_client_password }} # Disable hostname verification -consumer.ssl.endpoint.identification.algorithm= {% endif %} + # The converters specify the format of data in Kafka and how to translate it into Connect data. Every Connect user will # need to configure these based on the format they want their data in when loaded from or stored into Kafka key.converter=org.apache.kafka.connect.json.JsonConverter diff --git a/roles/amq_streams_cruise_control/README.md b/roles/amq_streams_cruise_control/README.md index e3c1c48..dbcc1bf 100644 --- a/roles/amq_streams_cruise_control/README.md +++ b/roles/amq_streams_cruise_control/README.md @@ -4,21 +4,22 @@ Perform installation and configuration of Cruise Control. | Variable | Description | Default | |:---------|:------------|:--------| -|`amq_streams_cruise_control_home`| Path to folder where Cruise Control has been installed | `/opt/cruise-control/` | -|`amq_streams_cruise_control_service_name`| Name of the systemd service running Cruise Control | `amq_streams_cruise_control` | -|`amq_streams_cruise_control_server_start`| Path to start script for systemd service managing Cruise Control | `{{ amq_streams_cruise_control_home }}/kafka-cruise-control-start.sh` | -|`amq_streams_cruise_control_server_stop`| Path to stop script for systemd service managing Cruise Control | `{{ amq_streams_cruise_control_home }}/kafka-cruise-control-stop.sh` | -|`amq_streams_cruise_control_server_config`| Path to config file for Cruise Control service | `/etc/amq_streams_cruise_control.properties` | -|`amq_streams_cruise_control_config_template`| Path to template defining the systemd service for Cruise Control | `templates/service.conf.j2` | -|`amq_streams_cruise_control_config_properties_template`| Path to template defining the config file for Cruise Control | `templates/cruisecontrol.properties.j2` | -|`amq_streams_cruise_control_user`| User account running the Cruise Control service | `root` | -|`amq_streams_cruise_control_group`| Groupname of the account running the Cruise Control service | `root` | -|`amq_streams_cruise_control_zk_host`| Hostname of the Zookeeper instance used by Cruise Control to communicate with the ensemble | `{{ groups['zookeepers'][0] }}` | -|`amq_streams_cruise_control_broker_host`| Hostname of the Zookeeper instance used by Cruise Control to communicate with the ensemble | `{{ groups['brokers'][0] }}` | -|`amq_streams_cruise_control_host`| Name of the host system running Cruise Control | `localhost` | -|`amq_streams_cruise_control_port`| Port used communicate with Cruise Control | `9090` | -|`amq_streams_cruise_control_api_path`| Context of the HTTP API call to Cruise Control (don't modify unless you know what you are doing) | `kafkacruisecontrol` | -|`amq_streams_cruise_control_operation_exec`| Set to False to display the URL built, but do not execute it (debug) | `True` | +|`redhat_streams_cruise_control_home`| Path to folder where Cruise Control has been installed | `/opt/cruise-control/` | +|`redhat_streams_cruise_control_service_name`| Name of the systemd service running Cruise Control | `redhat_streams_cruise_control` | +|`redhat_streams_cruise_control_server_start`| Path to start script for systemd service managing Cruise Control | `{{ redhat_streams_cruise_control_home }}/kafka-cruise-control-start.sh` | +|`redhat_streams_cruise_control_server_stop`| Path to stop script for systemd service managing Cruise Control | `{{ redhat_streams_cruise_control_home }}/kafka-cruise-control-stop.sh` | +|`redhat_streams_cruise_control_server_config`| Path to config file for Cruise Control service | `/etc/redhat_streams_cruise_control.properties` | +|`redhat_streams_cruise_control_config_template`| Path to template defining the systemd service for Cruise Control | `templates/service.conf.j2` | +|`redhat_streams_cruise_control_config_properties_template`| Path to template defining the config file for Cruise Control | `templates/cruisecontrol.properties.j2` | +|`redhat_streams_cruise_control_user`| User account running the Cruise Control service | `root` | +|`redhat_streams_cruise_control_group`| Groupname of the account running the Cruise Control service | `root` | +|`redhat_streams_cruise_control_zk_host`| Hostname of the Zookeeper instance used by Cruise Control to communicate with the ensemble | `{{ groups['zookeepers'][0] }}` | +|`redhat_streams_cruise_control_broker_host`| Hostname of the broker instance used by Cruise Control to communicate with the ensemble | `{{ groups['brokers'][0] }}` | +|`redhat_streams_cruise_control_host`| Name of the host system running Cruise Control | `localhost` | +|`redhat_streams_cruise_control_port`| Port used to communicate with Cruise Control | `9090` | +|`redhat_streams_cruise_control_api_path`| Context of the HTTP API call to Cruise Control (don't modify unless you know what you are doing) | `kafkacruisecontrol` | +|`redhat_streams_cruise_control_operation_exec`| Set to False to display the URL built, but do not execute it (debug) | `True` | + ## License diff --git a/roles/amq_streams_cruise_control/defaults/main.yml b/roles/amq_streams_cruise_control/defaults/main.yml index 1e3ad6d..de54006 100644 --- a/roles/amq_streams_cruise_control/defaults/main.yml +++ b/roles/amq_streams_cruise_control/defaults/main.yml @@ -1,30 +1,30 @@ --- -amq_streams_cruise_control_enabled: false -amq_streams_cruise_control_home: /opt/cruise-control/ -amq_streams_cruise_control_rhn_product_archive_file_pattern: '^.*/amq-streams-[0-9.]*-cruise-control-bin.zip' -amq_streams_cruise_control_service_name: amq_streams_cruise_control -amq_streams_cruise_control_server_start: "{{ amq_streams_cruise_control_home }}/kafka-cruise-control-start.sh" -amq_streams_cruise_control_server_stop: "{{ amq_streams_cruise_control_home }}/kafka-cruise-control-stop.sh" -amq_streams_cruise_control_version: 2.6.0 -amq_streams_cruise_control_archive_file: "amq-streams-{{ amq_streams_cruise_control_version }}-cruise-control-bin.zip" -amq_streams_cruise_control_server_config: "/etc/amq_streams_cruise_control.properties" -amq_streams_cruise_control_config_template: 'templates/service.conf.j2' -amq_streams_cruise_control_config_properties_template: 'templates/cruisecontrol.properties.j2' -amq_streams_cruise_control_path_to_log4j_properties: "{{ amq_streams_cruise_control_home }}/config/log4j.properties" -amq_streams_cruise_control_log4j_template: 'templates/log4j.properties.j2' -amq_streams_cruise_control_logfilename: '/var/log/cruise-control' -amq_streams_cruise_control_logfiles_requires_priv_escalation: yes -amq_streams_cruise_control_capacity_template: 'templates/capacity.json.j2' -amq_streams_cruise_control_path_to_capacity_file: "{{ amq_streams_cruise_control_home }}/config/capacity.json" -amq_streams_cruise_control_path_to_capacity_file_require_priv_escalation: yes -amq_streams_cruise_control_user: root -amq_streams_cruise_control_group: root -amq_streams_cruise_control_zk_host: "{{ groups['zookeepers'][0] }}" -amq_streams_cruise_control_broker_host: "{{ groups['brokers'][0] }}" -amq_streams_cruise_control_replicator_factor: 1 +redhat_streams_cruise_control_enabled: false +redhat_streams_cruise_control_home: /opt/cruise-control/ +redhat_streams_cruise_control_rhn_product_archive_file_pattern: '^.*/redhat-streams-[0-9.]*-cruise-control-bin.zip' +redhat_streams_cruise_control_service_name: redhat_streams_cruise_control +redhat_streams_cruise_control_server_start: "{{ redhat_streams_cruise_control_home }}/kafka-cruise-control-start.sh" +redhat_streams_cruise_control_server_stop: "{{ redhat_streams_cruise_control_home }}/kafka-cruise-control-stop.sh" +redhat_streams_cruise_control_version: 2.6.0 +redhat_streams_cruise_control_archive_file: "redhat-streams-{{ redhat_streams_cruise_control_version }}-cruise-control-bin.zip" +redhat_streams_cruise_control_server_config: "/etc/redhat_streams_cruise_control.properties" +redhat_streams_cruise_control_config_template: 'templates/service.conf.j2' +redhat_streams_cruise_control_config_properties_template: 'templates/cruisecontrol.properties.j2' +redhat_streams_cruise_control_path_to_log4j_properties: "{{ redhat_streams_cruise_control_home }}/config/log4j.properties" +redhat_streams_cruise_control_log4j_template: 'templates/log4j.properties.j2' +redhat_streams_cruise_control_logfilename: '/var/log/cruise-control' +redhat_streams_cruise_control_logfiles_requires_priv_escalation: yes +redhat_streams_cruise_control_capacity_template: 'templates/capacity.json.j2' +redhat_streams_cruise_control_path_to_capacity_file: "{{ redhat_streams_cruise_control_home }}/config/capacity.json" +redhat_streams_cruise_control_path_to_capacity_file_require_priv_escalation: yes +redhat_streams_cruise_control_user: root +redhat_streams_cruise_control_group: root +redhat_streams_cruise_control_zk_host: "{{ groups['zookeepers'][0] }}" +redhat_streams_cruise_control_broker_host: "{{ groups['brokers'][0] }}" +redhat_streams_cruise_control_replicator_factor: 1 # Cruise Control HTTP API -amq_streams_cruise_control_host: 'localhost' -amq_streams_cruise_control_port: 9090 -amq_streams_cruise_control_api_path: 'kafkacruisecontrol' +redhat_streams_cruise_control_host: 'localhost' +redhat_streams_cruise_control_port: 9090 +redhat_streams_cruise_control_api_path: 'kafkacruisecontrol' # Switch next var to False to display the HTTP request -amq_streams_cruise_control_operation_exec: True +redhat_streams_cruise_control_operation_exec: True diff --git a/roles/amq_streams_exporter/README.md b/roles/amq_streams_exporter/README.md index 90b5e9d..a344e37 100644 --- a/roles/amq_streams_exporter/README.md +++ b/roles/amq_streams_exporter/README.md @@ -6,28 +6,28 @@ Perform installation and configuration of Kafka Export. | Variable | Description | Default | |:---------|:------------|:--------| -|`amq_streams_exporter_target_arch`| Specify physical architecture of target host | `{{ ansible_architecture }}` | -|`amq_streams_exporter_version`| Exporter version to be used | `1.7.0` | -|`amq_streams_exporter_download_base_url`| Base URL for downloading Exporter archive | `https://github.com/danielqsj/kafka_exporter/releases/download/` | -|`amq_streams_exporter_download_url`| Download URL for Exporter archive | `{{ amq_streams_exporter_download_base_url }}v{{ amq_streams_exporter_version }}/kafka_exporter-{{ amq_streams_exporter_version }}.{{ amq_streams_exporter_target_system }}-{{ amq_streams_exporter_target_arch }}.tar.gz` | -|`amq_streams_exporter_archive_folder`| Folder name for Exporter | `kafka_exporter-{{ amq_streams_exporter_version }}.{{ amq_streams_exporter_target_system }}-{{ amq_streams_exporter_target_arch }}` | -|`amq_streams_exporter_archive_name`| Exporter archive name | `{{ amq_streams_exporter_archive_folder }}.tar.gz` | -|`amq_streams_exporter_download_dir`| Download dirname | `{{ lookup('env','PWD') | default('/opt') }}` | -|`amq_streams_exporter_download_path`| Path to download directory (on controller) | `{{ amq_streams_exporter_download_dir }}/{{ amq_streams_exporter_archive_name }}` | -|`amq_streams_exporter_download_host`| Hostname of download host (if not controller) | `localhost` | -|`amq_streams_exporter_home`| Exporter home directory | `{{ amq_streams_common_home }}` | -|`amq_streams_exporter_server_start`| Exporter start script | `{{ amq_streams_common_home }}/{{ amq_streams_exporter_archive_folder }}/{{ amq_streams_exporter_server_start_script }}` | -|`amq_streams_exporter_dependencies`| Dependencies required by Exporter (RPM packages names) | `['tar', 'unzip']` | -|`amq_streams_exporter_service_name`| Service name for the Exporter instance | `amq_streams_exporter` | -|`amq_streams_exporter_server_port`| Exporter server port | `9308` | -|`amq_streams_exporter_server_start_script`| Exporter start script name | `kafka_exporter` | -|`amq_streams_exporter_systemd_env_file`| Exporter service config file | `/etc/amq_streams_exporter.conf` | -|`amq_streams_exporter_service_config_template`| Templates to use for the systemd service for Exporter | `templates/service.conf.j2` | -|`amq_streams_exporter_user`| User account, on targets, running the Exporter | `amq_streams_exporter` | -|`amq_streams_exporter_group`| Group account, on targets, Exporter user belongs to | `amq_streams` | -|`amq_streams_exporter_java_opts`| Java options to pass to Exporter JVM | `` | -|`amq_streams_exporter_server_port_delay`| Delay before checking Exporter server's port availability | `0` | -|`amq_streams_exporter_server_port_skip_wait`| Skip waiting for Exporter server port to be available | `False` | -|`amq_streams_exporter_broker_server_host`| Broker's hostname | `{{ groups['brokers'][0] | default('localhost') }}` | -|`amq_streams_exporter_broker_server_port`| Broker's port | `9092` | -|`amq_streams_exporter_server_extra_args`| Extra arguments to Exporter service start command | `--group.filter='.*' --topic.filter='.*' --offset.show-all --verbosity=0 --kafka.version='{{ amq_streams_common_product_version }}' --kafka.server={{ amq_streams_exporter_broker_server_host }}:{{ amq_streams_exporter_broker_server_port }}` | +|`redhat_streams_exporter_target_arch`| Specify physical architecture of target host | `{{ ansible_architecture }}` | +|`redhat_streams_exporter_version`| Exporter version to be used | `1.7.0` | +|`redhat_streams_exporter_download_base_url`| Base URL for downloading Exporter archive | `https://github.com/danielqsj/kafka_exporter/releases/download/` | +|`redhat_streams_exporter_download_url`| Download URL for Exporter archive | `{{ redhat_streams_exporter_download_base_url }}v{{ redhat_streams_exporter_version }}/kafka_exporter-{{ redhat_streams_exporter_version }}.{{ redhat_streams_exporter_target_system }}-{{ redhat_streams_exporter_target_arch }}.tar.gz` | +|`redhat_streams_exporter_archive_folder`| Folder name for Exporter | `kafka_exporter-{{ redhat_streams_exporter_version }}.{{ redhat_streams_exporter_target_system }}-{{ redhat_streams_exporter_target_arch }}` | +|`redhat_streams_exporter_archive_name`| Exporter archive name | `{{ redhat_streams_exporter_archive_folder }}.tar.gz` | +|`redhat_streams_exporter_download_dir`| Download dirname | `{{ lookup('env','PWD') | default('/opt') }}` | +|`redhat_streams_exporter_download_path`| Path to download directory (on controller) | `{{ redhat_streams_exporter_download_dir }}/{{ redhat_streams_exporter_archive_name }}` | +|`redhat_streams_exporter_download_host`| Hostname of download host (if not controller) | `localhost` | +|`redhat_streams_exporter_home`| Exporter home directory | `{{ redhat_streams_common_home }}` | +|`redhat_streams_exporter_server_start`| Exporter start script | `{{ redhat_streams_common_home }}/{{ redhat_streams_exporter_archive_folder }}/{{ redhat_streams_exporter_server_start_script }}` | +|`redhat_streams_exporter_dependencies`| Dependencies required by Exporter (RPM packages names) | `['tar', 'unzip']` | +|`redhat_streams_exporter_service_name`| Service name for the Exporter instance | `redhat_streams_exporter` | +|`redhat_streams_exporter_server_port`| Exporter server port | `9308` | +|`redhat_streams_exporter_server_start_script`| Exporter start script name | `kafka_exporter` | +|`redhat_streams_exporter_systemd_env_file`| Exporter service config file | `/etc/redhat_streams_exporter.conf` | +|`redhat_streams_exporter_service_config_template`| Templates to use for the systemd service for Exporter | `templates/service.conf.j2` | +|`redhat_streams_exporter_user`| User account, on targets, running the Exporter | `redhat_streams_exporter` | +|`redhat_streams_exporter_group`| Group account, on targets, Exporter user belongs to | `redhat_streams` | +|`redhat_streams_exporter_java_opts`| Java options to pass to Exporter JVM | `` | +|`redhat_streams_exporter_server_port_delay`| Delay before checking Exporter server's port availability | `0` | +|`redhat_streams_exporter_server_port_skip_wait`| Skip waiting for Exporter server port to be available | `False` | +|`redhat_streams_exporter_broker_server_host`| Broker's hostname | `{{ groups['brokers'][0] | default('localhost') }}` | +|`redhat_streams_exporter_broker_server_port`| Broker's port | `9092` | +|`redhat_streams_exporter_server_extra_args`| Extra arguments to Exporter service start command | `--group.filter='.*' --topic.filter='.*' --offset.show-all --verbosity=0 --kafka.version='{{ redhat_streams_common_product_version }}' --kafka.server={{ redhat_streams_exporter_broker_server_host }}:{{ redhat_streams_exporter_broker_server_port }}` | diff --git a/roles/amq_streams_exporter/defaults/main.yml b/roles/amq_streams_exporter/defaults/main.yml index a423a32..075de44 100644 --- a/roles/amq_streams_exporter/defaults/main.yml +++ b/roles/amq_streams_exporter/defaults/main.yml @@ -1,33 +1,33 @@ --- -amq_streams_exporter_enabled: True -amq_streams_exporter_target_arch: "{{ ansible_architecture }}" -amq_streams_exporter_version: 1.7.0 -amq_streams_exporter_download_base_url: 'https://github.com/danielqsj/kafka_exporter/releases/download/' -amq_streams_exporter_download_url: "{{ amq_streams_exporter_download_base_url }}v{{ amq_streams_exporter_version }}/kafka_exporter-{{ amq_streams_exporter_version }}.{{ amq_streams_exporter_target_system }}-{{ amq_streams_exporter_target_arch }}.tar.gz" -amq_streams_exporter_archive_folder: "kafka_exporter-{{ amq_streams_exporter_version }}.{{ amq_streams_exporter_target_system }}-{{ amq_streams_exporter_target_arch }}" -amq_streams_exporter_archive_name: "{{ amq_streams_exporter_archive_folder }}.tar.gz" -amq_streams_exporter_download_dir: "{{ lookup('env','PWD') | default('/opt') }}" -amq_streams_exporter_download_path: "{{ amq_streams_exporter_download_dir }}/{{ amq_streams_exporter_archive_name }}" -amq_streams_exporter_download_host: localhost -amq_streams_exporter_home: "{{ amq_streams_common_home }}" -amq_streams_exporter_server_start: "{{ amq_streams_common_home }}/{{ amq_streams_exporter_archive_folder }}/{{ amq_streams_exporter_server_start_script }}" -amq_streams_exporter_dependencies: +redhat_streams_exporter_enabled: True +redhat_streams_exporter_target_arch: "{{ ansible_architecture }}" +redhat_streams_exporter_version: 1.7.0 +redhat_streams_exporter_download_base_url: 'https://github.com/danielqsj/kafka_exporter/releases/download/' +redhat_streams_exporter_download_url: "{{ redhat_streams_exporter_download_base_url }}v{{ redhat_streams_exporter_version }}/kafka_exporter-{{ redhat_streams_exporter_version }}.{{ redhat_streams_exporter_target_system }}-{{ redhat_streams_exporter_target_arch }}.tar.gz" +redhat_streams_exporter_archive_folder: "kafka_exporter-{{ redhat_streams_exporter_version }}.{{ redhat_streams_exporter_target_system }}-{{ redhat_streams_exporter_target_arch }}" +redhat_streams_exporter_archive_name: "{{ redhat_streams_exporter_archive_folder }}.tar.gz" +redhat_streams_exporter_download_dir: "{{ lookup('env','PWD') | default('/opt') }}" +redhat_streams_exporter_download_path: "{{ redhat_streams_exporter_download_dir }}/{{ redhat_streams_exporter_archive_name }}" +redhat_streams_exporter_download_host: localhost +redhat_streams_exporter_home: "{{ redhat_streams_common_home }}" +redhat_streams_exporter_server_start: "{{ redhat_streams_common_home }}/{{ redhat_streams_exporter_archive_folder }}/{{ redhat_streams_exporter_server_start_script }}" +redhat_streams_exporter_dependencies: - tar - unzip -amq_streams_exporter_service_name: amq_streams_exporter -amq_streams_exporter_server_port: 9308 -amq_streams_exporter_server_start_script: kafka_exporter +redhat_streams_exporter_service_name: redhat_streams_exporter +redhat_streams_exporter_server_port: 9308 +redhat_streams_exporter_server_start_script: kafka_exporter -#amq_streams_exporter_server_config: /etc/amq_streams_exporter -#amq_streams_exporter_config_template: templates/exporter.properties.j2 -amq_streams_exporter_systemd_env_file: /etc/amq_streams_exporter.conf -amq_streams_exporter_service_config_template: templates/service.conf.j2 -#amq_streams_exporter_service_config_template: templates/service.conf.j2 -amq_streams_exporter_user: amq_streams_exporter -amq_streams_exporter_group: amq_streams -amq_streams_exporter_java_opts: '' -amq_streams_exporter_server_port_delay: 0 -amq_streams_exporter_server_port_skip_wait: False -amq_streams_exporter_broker_server_host: "{{ groups['brokers'][0] | default('localhost') }}" -amq_streams_exporter_broker_server_port: 9092 -amq_streams_exporter_server_extra_args: "--group.filter='.*' --topic.filter='.*' --offset.show-all --verbosity=0 --kafka.version='{{ amq_streams_common_product_version }}' --kafka.server={{ amq_streams_exporter_broker_server_host }}:{{ amq_streams_exporter_broker_server_port }}" +# redhat_streams_exporter_server_config: /etc/redhat_streams_exporter +# redhat_streams_exporter_config_template: templates/exporter.properties.j2 +redhat_streams_exporter_systemd_env_file: /etc/redhat_streams_exporter.conf +redhat_streams_exporter_service_config_template: templates/service.conf.j2 +# redhat_streams_exporter_service_config_template: templates/service.conf.j2 +redhat_streams_exporter_user: redhat_streams_exporter +redhat_streams_exporter_group: redhat_streams +redhat_streams_exporter_java_opts: '' +redhat_streams_exporter_server_port_delay: 0 +redhat_streams_exporter_server_port_skip_wait: False +redhat_streams_exporter_broker_server_host: "{{ groups['brokers'][0] | default('localhost') }}" +redhat_streams_exporter_broker_server_port: 9092 +redhat_streams_exporter_server_extra_args: "--group.filter='.*' --topic.filter='.*' --offset.show-all --verbosity=0 --kafka.version='{{ redhat_streams_common_product_version }}' --kafka.server={{ redhat_streams_exporter_broker_server_host }}:{{ redhat_streams_exporter_broker_server_port }}" diff --git a/roles/amq_streams_zookeeper/README.md b/roles/amq_streams_zookeeper/README.md index cb1557b..9d27747 100644 --- a/roles/amq_streams_zookeeper/README.md +++ b/roles/amq_streams_zookeeper/README.md @@ -20,39 +20,39 @@ zknode3 | Variable | Description | Default | |:---------|:------------|:--------| -|`amq_streams_zookeeper_enabled` | Enable zookeeper ensemble | `true` | -|`amq_streams_zookeeper_config` | Zookeeper configuration file | `/etc/amq_streams_zookeeper.properties` | -|`amq_streams_zookeeper_config_template` | Zookeeper template configuration file | `templates/zookeeper.properties.j2` | -|`amq_streams_zookeeper_server_start` | Zookeeper server start file | `{{ amq_streams_common_home }}/bin/zookeeper-server-start.sh` | -|`amq_streams_zookeeper_user` | Zookeeper user | `amq_streams_zookeeper` | -|`amq_streams_zookeeper_group` | User group | `amq_streams` | -|`amq_streams_zookeeper_service_name` | Zookeeper service name | `amq_streams_zookeeper` | -|`amq_streams_zookeeper_service_config_template` | Zookeeper template service file | `templates/service.conf.j2` | -|`amq_streams_zookeeper_service_env_file` | Zookeeper service environment configuration file | `/etc/zookeeper.conf` | -|`amq_streams_zookeeper_data_dir` | Zookeeper data folder | `/var/lib/{{ amq_streams_zookeeper_service_name }}/` | -|`amq_streams_zookeeper_logs_dir` | Zookeeper logs folder | `/var/log/{{ amq_streams_zookeeper_service_name }}/` | -|`amq_streams_zookeeper_max_client_cnxns` | Max client connections | `0` | -|`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 | | -|`amq_streams_zookeeper_java_java_gc_log_opts` | Default values to apply to `KAFKA_GC_LOG_OPTS` env variable | | -|`amq_streams_zookeeper_java_jmx_opts` | Default values to apply to `KAFKA_JMX_OPTS` env variable | | -|`amq_streams_zookeeper_host` | | `localhost` | -|`amq_streams_zookeeper_port` | | `2181` | -|`amq_streams_firewalld_package_name` | | `- firewalld` | -|`amq_streams_firewalld_enabled` | | `false` | -|`amq_streams_zookeeper_init_limit` | | `5` | -|`amq_streams_zookeeper_sync_limit` | | `2` | -|`amq_streams_zookeeper_cluster_port_start` | | `2888` | -|`amq_streams_zookeeper_cluster_port_end` | | `3888` | -|`amq_streams_zookeeper_auth_enabled` | Enable Zookeeper authentication | `false` | -|`amq_streams_zookeeper_auth_config` | JAAS file to set up Zookeeper authentication | `/etc/zookeeper-jaas.conf` | -|`amq_streams_zookeeper_auth_config_template` | JAAS template for Zookeeper authentication | `templates/zookeeper-jaas.conf.j2` | -|`amq_streams_zookeeper_inventory_group` | Identify the group of zookeeper nodes | `groups['zookeepers']` | +|`redhat_streams_zookeeper_enabled` | Enable zookeeper ensemble | `true` | +|`redhat_streams_zookeeper_config` | Zookeeper configuration file | `/etc/redhat_streams_zookeeper.properties` | +|`redhat_streams_zookeeper_config_template` | Zookeeper template configuration file | `templates/zookeeper.properties.j2` | +|`redhat_streams_zookeeper_server_start` | Zookeeper server start file | `{{ redhat_streams_common_home }}/bin/zookeeper-server-start.sh` | +|`redhat_streams_zookeeper_user` | Zookeeper user | `redhat_streams_zookeeper` | +|`redhat_streams_zookeeper_group` | User group | `redhat_streams` | +|`redhat_streams_zookeeper_service_name` | Zookeeper service name | `redhat_streams_zookeeper` | +|`redhat_streams_zookeeper_service_config_template` | Zookeeper template service file | `templates/service.conf.j2` | +|`redhat_streams_zookeeper_service_env_file` | Zookeeper service environment configuration file | `/etc/zookeeper.conf` | +|`redhat_streams_zookeeper_data_dir` | Zookeeper data folder | `/var/lib/{{ redhat_streams_zookeeper_service_name }}/` | +|`redhat_streams_zookeeper_logs_dir` | Zookeeper logs folder | `/var/log/{{ redhat_streams_zookeeper_service_name }}/` | +|`redhat_streams_zookeeper_max_client_cnxns` | Max client connections | `0` | +|`redhat_streams_zookeeper_admin_enable_server` | Enable zookeeper administration server | `false` | +|`redhat_streams_zookeeper_instance_count_enabled` | Count zookeeper instances | `true` | +|`redhat_streams_zookeeper_instance_count` |  | `0` | +|`redhat_streams_zookeeper_zookeeper_id` | Zookeeper variable to identify the zookeeper in a cluster | | +|`redhat_streams_zookeeper_java_opts` | Default values to apply to `KAFKA_OPTS` env variable |  | +|`redhat_streams_zookeeper_java_heap_opts` | Default values to apply to `KAFKA_HEAP_OPTS` env variable | `-Xmx512M -Xms512M` | +|`redhat_streams_zookeeper_java_performance_opts` | Default values to apply to `KAFKA_JVM_PERFORMANCE_OPTS` env variable |  | +|`redhat_streams_zookeeper_java_java_gc_log_opts` | Default values to apply to `KAFKA_GC_LOG_OPTS` env variable |  | +|`redhat_streams_zookeeper_java_jmx_opts` | Default values to apply to `KAFKA_JMX_OPTS` env variable |  | +|`redhat_streams_zookeeper_host` |  | `localhost` | +|`redhat_streams_zookeeper_port` |  | `2181` | +|`redhat_streams_firewalld_package_name` |  | `- firewalld` | +|`redhat_streams_firewalld_enabled` |  | `false` | +|`redhat_streams_zookeeper_init_limit` |  | `5` | +|`redhat_streams_zookeeper_sync_limit` |  | `2` | +|`redhat_streams_zookeeper_cluster_port_start` |  | `2888` | +|`redhat_streams_zookeeper_cluster_port_end` |  | `3888` | +|`redhat_streams_zookeeper_auth_enabled` | Enable Zookeeper authentication | `false` | +|`redhat_streams_zookeeper_auth_config` | JAAS file to set up Zookeeper authentication | `/etc/zookeeper-jaas.conf` | +|`redhat_streams_zookeeper_auth_config_template` | JAAS template for Zookeeper authentication | `templates/zookeeper-jaas.conf.j2` | +|`redhat_streams_zookeeper_inventory_group` | Identify the group of zookeeper nodes | `groups['zookeepers']` | ## Role Variables @@ -60,8 +60,8 @@ The following are a set of required variables for the role: | Variable | Description | Required | |:---------|:------------|:---------| -|`amq_streams_zookeeper_auth_user` | Zookeeper user to authenticate. Mandatory if `amq_streams_zookeeper_auth_enabled: true` | '' | -|`amq_streams_zookeeper_auth_pass` | Zookeeper user password to authenticate. Mandatory if `amq_streams_zookeeper_auth_enabled: true`| '' | +|`redhat_streams_zookeeper_auth_user` | Zookeeper user to authenticate. Mandatory if `amq_streams_zookeeper_auth_enabled: true` | '' | +|`redhat_streams_zookeeper_auth_pass` | Zookeeper user password to authenticate. Mandatory if `redhat_streams_zookeeper_auth_enabled: true`| '' | ## License diff --git a/roles/amq_streams_zookeeper/defaults/main.yml b/roles/amq_streams_zookeeper/defaults/main.yml index af20f17..6d5dfce 100644 --- a/roles/amq_streams_zookeeper/defaults/main.yml +++ b/roles/amq_streams_zookeeper/defaults/main.yml @@ -1,54 +1,54 @@ --- -amq_streams_zookeeper_enabled: true -amq_streams_zookeeper_config: /etc/amq_streams_zookeeper.properties -amq_streams_zookeeper_config_template: templates/zookeeper.properties.j2 -amq_streams_zookeeper_server_start: "{{ amq_streams_common_home }}/bin/zookeeper-server-start.sh" -amq_streams_zookeeper_user: 'amq_streams_zookeeper' -amq_streams_zookeeper_group: 'amq_streams' -amq_streams_zookeeper_service_name: 'amq_streams_zookeeper' -amq_streams_zookeeper_service_config_template: 'templates/service.conf.j2' -amq_streams_zookeeper_restart_requires_priv_escalation: yes -amq_streams_zookeeper_service_env_file: '/etc/zookeeper.conf' -amq_streams_zookeeper_data_dir: "/var/lib/{{ amq_streams_zookeeper_service_name }}/" -amq_streams_zookeeper_logs_dir: "/var/log/{{ amq_streams_zookeeper_service_name }}/" -amq_streams_zookeeper_data_require_priv_escalation: yes -amq_streams_zookeeper_max_client_cnxns: 0 -amq_streams_zookeeper_admin_enable_server: 'true' -amq_streams_zookeeper_admin_server_port: 8080 -amq_streams_zookeeper_admin_server_port_delay: 0 -amq_streams_zookeeper_admin_server_skip_wait: False -amq_streams_zookeeper_instance_count_enabled: true -amq_streams_zookeeper_inventory_group_name: 'zookeepers' -amq_streams_zookeeper_instance_count: "{{ groups[amq_streams_zookeeper_inventory_group_name] | length }}" -amq_streams_zookeeper_4wl_commands_whitelist: stat,dump # "*" -amq_streams_zookeeper_java_heap_opts: '-Xmx512M -Xms512M' -amq_streams_zookeeper_sysctl_vm_max_map_count: 65530 -amq_streams_zookeeper_ulimit_max_value: 1024 +redhat_streams_zookeeper_enabled: true +redhat_streams_zookeeper_config: /etc/redhat_streams_zookeeper.properties +redhat_streams_zookeeper_config_template: templates/zookeeper.properties.j2 +redhat_streams_zookeeper_server_start: "{{ redhat_streams_common_home }}/bin/zookeeper-server-start.sh" +redhat_streams_zookeeper_user: 'redhat_streams_zookeeper' +redhat_streams_zookeeper_group: 'redhat_streams' +redhat_streams_zookeeper_service_name: 'redhat_streams_zookeeper' +redhat_streams_zookeeper_service_config_template: 'templates/service.conf.j2' +redhat_streams_zookeeper_restart_requires_priv_escalation: yes +redhat_streams_zookeeper_service_env_file: '/etc/zookeeper.conf' +redhat_streams_zookeeper_data_dir: "/var/lib/{{ redhat_streams_zookeeper_service_name }}/" +redhat_streams_zookeeper_logs_dir: "/var/log/{{ redhat_streams_zookeeper_service_name }}/" +redhat_streams_zookeeper_data_require_priv_escalation: yes +redhat_streams_zookeeper_max_client_cnxns: 0 +redhat_streams_zookeeper_admin_enable_server: 'true' +redhat_streams_zookeeper_admin_server_port: 8080 +redhat_streams_zookeeper_admin_server_port_delay: 0 +redhat_streams_zookeeper_admin_server_skip_wait: False +redhat_streams_zookeeper_instance_count_enabled: true +redhat_streams_zookeeper_inventory_group_name: 'zookeepers' +redhat_streams_zookeeper_instance_count: "{{ groups[redhat_streams_zookeeper_inventory_group_name] | length }}" +redhat_streams_zookeeper_4wl_commands_whitelist: stat,dump # "*" +redhat_streams_zookeeper_java_heap_opts: '-Xmx512M -Xms512M' +redhat_streams_zookeeper_sysctl_vm_max_map_count: 65530 +redhat_streams_zookeeper_ulimit_max_value: 1024 -amq_streams_zookeeper_host: localhost -amq_streams_zookeeper_port: 2181 -amq_streams_zookeeper_init_limit: 5 -amq_streams_zookeeper_sync_limit: 2 -amq_streams_zookeeper_cluster_port_start: 2888 -amq_streams_zookeeper_cluster_port_end: 3888 +redhat_streams_zookeeper_host: localhost +redhat_streams_zookeeper_port: 2181 +redhat_streams_zookeeper_init_limit: 5 +redhat_streams_zookeeper_sync_limit: 2 +redhat_streams_zookeeper_cluster_port_start: 2888 +redhat_streams_zookeeper_cluster_port_end: 3888 -amq_streams_zookeeper_inventory_group: "{{ groups[amq_streams_zookeeper_inventory_group_name] | default([]) }}" +redhat_streams_zookeeper_inventory_group: "{{ groups[redhat_streams_zookeeper_inventory_group_name] | default([]) }}" -amq_streams_firewalld_package_name: +redhat_streams_firewalld_package_name: - firewalld -amq_streams_firewalld_enabled: false +redhat_streams_firewalld_enabled: false # Zookeeper Authentication with SASL -amq_streams_zookeeper_auth_enabled: false -amq_streams_zookeeper_auth_config: /etc/zookeeper-jaas.conf -amq_streams_zookeeper_auth_config_template: templates/zookeeper-jaas.conf.j2 -amq_streams_zookeeper_auth_user: zookeeper -amq_streams_zookeeper_auth_pass: PLEASE_CHANGE_ME_I_AM_NO_GOOD_FOR_PRODUCTION +redhat_streams_zookeeper_auth_enabled: false +redhat_streams_zookeeper_auth_config: /etc/zookeeper-jaas.conf +redhat_streams_zookeeper_auth_config_template: templates/zookeeper-jaas.conf.j2 +redhat_streams_zookeeper_auth_user: zookeeper +redhat_streams_zookeeper_auth_pass: PLEASE_CHANGE_ME_I_AM_NO_GOOD_FOR_PRODUCTION -amq_streams_zookeeper_server_log_validation_min_size: 20 +redhat_streams_zookeeper_server_log_validation_min_size: 20 -amq_streams_zookeeper_prometheus_enabled: False -amq_streams_zookeeper_prometheus_port: 18080 -amq_streams_zookeeper_prometheus_bind_addr: '0.0.0.0' -amq_streams_zookeeper_prometheus_config_file: zk-config.yaml -amq_streams_zookeeper_prometheus_config_file_template: prometheus/zk-config.yaml.j2 +redhat_streams_zookeeper_prometheus_enabled: False +redhat_streams_zookeeper_prometheus_port: 18080 +redhat_streams_zookeeper_prometheus_bind_addr: '0.0.0.0' +redhat_streams_zookeeper_prometheus_config_file: zk-config.yaml +redhat_streams_zookeeper_prometheus_config_file_template: prometheus/zk-config.yaml.j2 diff --git a/roles/amq_streams_zookeeper/tasks/main.yml b/roles/amq_streams_zookeeper/tasks/main.yml index 6d635ed..9357e5f 100644 --- a/roles/amq_streams_zookeeper/tasks/main.yml +++ b/roles/amq_streams_zookeeper/tasks/main.yml @@ -1,73 +1,73 @@ --- - name: "Ensure user for zookeeper exists (if provided)." ansible.builtin.include_role: - name: amq_streams_common + name: redhat_streams_common tasks_from: prereqs.yml vars: - prereqs_user: "{{ amq_streams_zookeeper_user }}" - prereqs_group: "{{ amq_streams_zookeeper_group }}" + prereqs_user: "{{ redhat_streams_zookeeper_user }}" + prereqs_group: "{{ redhat_streams_zookeeper_group }}" - name: "Ensure OS has been properly tuned (RHEL specific)." ansible.builtin.include_role: - name: amq_streams_common + name: redhat_streams_common tasks_from: os_tuning.yml vars: - sysctl_vm_max_map_count: "{{ amq_streams_zookeeper_sysctl_vm_max_map_count }}" - ulimit_user: "{{ amq_streams_zookeeper_user }}" - ulimit_limit: "{{ amq_streams_zookeeper_ulimit_max_value }}" + sysctl_vm_max_map_count: "{{ redhat_streams_zookeeper_sysctl_vm_max_map_count }}" + ulimit_user: "{{ redhat_streams_zookeeper_user }}" + ulimit_limit: "{{ redhat_streams_zookeeper_ulimit_max_value }}" when: - - ansible_distribution == "RedHat" and amq_streams_common_systctl_update_enable is defined and amq_streams_common_systctl_update_enable + - ansible_distribution == "RedHat" and redhat_streams_common_systctl_update_enable is defined and redhat_streams_common_systctl_update_enable -- name: "Ensure Prometheus requirements are met (if enabled: {{ amq_streams_zookeeper_prometheus_enabled }}) - {{ amq_streams_zookeeper_prometheus_config_file_template }}." +- name: "Ensure Prometheus requirements are met (if enabled: {{ redhat_streams_zookeeper_prometheus_enabled }}) - {{ redhat_streams_zookeeper_prometheus_config_file_template }}." ansible.builtin.include_role: - name: amq_streams_common + name: redhat_streams_common tasks_from: prometheus.yml vars: - amq_streams_common_prometheus_port: "{{ amq_streams_zookeeper_prometheus_port }}" - amq_streams_common_prometheus_bind_addr: "{{ amq_streams_zookeeper_prometheus_bind_addr }}" - amq_streams_common_prometheus_config_file: "{{ amq_streams_zookeeper_prometheus_config_file }}" - amq_streams_common_prometheus_config_file_template: "{{ amq_streams_zookeeper_prometheus_config_file_template }}" + redhat_streams_common_prometheus_port: "{{ redhat_streams_zookeeper_prometheus_port }}" + redhat_streams_common_prometheus_bind_addr: "{{ redhat_streams_zookeeper_prometheus_bind_addr }}" + redhat_streams_common_prometheus_config_file: "{{ redhat_streams_zookeeper_prometheus_config_file }}" + redhat_streams_common_prometheus_config_file_template: "{{ redhat_streams_zookeeper_prometheus_config_file_template }}" when: - - amq_streams_zookeeper_prometheus_enabled is defined and amq_streams_zookeeper_prometheus_enabled + - redhat_streams_zookeeper_prometheus_enabled is defined and redhat_streams_zookeeper_prometheus_enabled - name: "Ensures Zookeeper data dir, myid and auth config (if enable) are set." - become: "{{ amq_streams_zookeeper_data_require_priv_escalation }}" + become: "{{ redhat_streams_zookeeper_data_require_priv_escalation }}" block: - name: "Ensure Zookeeper data dir exists and belongs to the appropriate user - if user is defined." ansible.builtin.file: - path: "{{ amq_streams_zookeeper_data_dir }}" + path: "{{ redhat_streams_zookeeper_data_dir }}" state: directory - owner: "{{ amq_streams_zookeeper_user | default(omit) }}" - group: "{{ amq_streams_zookeeper_group | default(omit) }}" + owner: "{{ redhat_streams_zookeeper_user | default(omit) }}" + group: "{{ redhat_streams_zookeeper_group | default(omit) }}" mode: 0755 when: - - amq_streams_zookeeper_data_dir is defined + - redhat_streams_zookeeper_data_dir is defined - name: "Configure 'myid' file based on the position in the zookeepers group or if it is defined on inventory" ansible.builtin.copy: - 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) }}" + content: "{{ redhat_streams_zookeeper_zookeeper_id | default(redhat_streams_zookeeper_inventory_group.index(inventory_hostname) + 1) }}" + dest: "{{ redhat_streams_zookeeper_data_dir }}/myid" + owner: "{{ redhat_streams_zookeeper_user | default(omit) }}" + group: "{{ redhat_streams_zookeeper_group | default(omit) }}" when: - - amq_streams_zookeeper_inventory_group is defined - - amq_streams_zookeeper_inventory_group | length > 0 + - redhat_streams_zookeeper_inventory_group is defined + - redhat_streams_zookeeper_inventory_group | length > 0 - name: "Configure Zookeeper authentication (if enabled)" ansible.builtin.template: - src: "{{ amq_streams_zookeeper_auth_config_template }}" - dest: "{{ amq_streams_zookeeper_auth_config }}" - owner: "{{ amq_streams_zookeeper_user | default(omit) }}" - group: "{{ amq_streams_zookeeper_group | default(omit) }}" + src: "{{ redhat_streams_zookeeper_auth_config_template }}" + dest: "{{ redhat_streams_zookeeper_auth_config }}" + owner: "{{ redhat_streams_zookeeper_user | default(omit) }}" + group: "{{ redhat_streams_zookeeper_group | default(omit) }}" mode: 0644 when: - - amq_streams_zookeeper_auth_enabled is defined and amq_streams_zookeeper_auth_enabled + - redhat_streams_zookeeper_auth_enabled is defined and redhat_streams_zookeeper_auth_enabled - name: "Enable Zookeeper authentication environment variable" ansible.builtin.set_fact: - amq_streams_zookeeper_java_opts: "-Djava.security.auth.login.config={{ amq_streams_zookeeper_auth_config }}" + redhat_streams_zookeeper_java_opts: "-Djava.security.auth.login.config={{ redhat_streams_zookeeper_auth_config }}" when: - - amq_streams_zookeeper_auth_enabled is defined and amq_streams_zookeeper_auth_enabled + - redhat_streams_zookeeper_auth_enabled is defined and redhat_streams_zookeeper_auth_enabled - name: "Configure Zookeeper as a systemd service." ansible.builtin.include_tasks: service.yml diff --git a/roles/amq_streams_zookeeper/templates/zookeeper.properties.j2 b/roles/amq_streams_zookeeper/templates/zookeeper.properties.j2 index ccad8eb..c43f9a1 100644 --- a/roles/amq_streams_zookeeper/templates/zookeeper.properties.j2 +++ b/roles/amq_streams_zookeeper/templates/zookeeper.properties.j2 @@ -16,42 +16,42 @@ # limitations under the License. # the directory where the snapshot is stored. -dataDir={{ amq_streams_zookeeper_data_dir }} +dataDir={{ redhat_streams_zookeeper_data_dir }} # the port at which the clients will connect -clientPort={{ amq_streams_zookeeper_port }} +clientPort={{ redhat_streams_zookeeper_port }} # disable the per-ip limit on the number of connections since this is a non-production config -maxClientCnxns={{ amq_streams_zookeeper_max_client_cnxns }} +maxClientCnxns={{ redhat_streams_zookeeper_max_client_cnxns }} # Enable command list - https://zookeeper.apache.org/doc/r3.5.5/zookeeperAdmin.html -4lw.commands.whitelist={{ amq_streams_zookeeper_4wl_commands_whitelist }} +4lw.commands.whitelist={{ redhat_streams_zookeeper_4wl_commands_whitelist }} # Disable the adminserver by default to avoid port conflicts. # Set the port to something non-conflicting if choosing to enable this -admin.enableServer={{ amq_streams_zookeeper_admin_enable_server }} -{% if amq_streams_zookeeper_admin_enable_server %} -admin.serverPort={{ amq_streams_zookeeper_admin_server_port }} +admin.enableServer={{ redhat_streams_zookeeper_admin_enable_server }} +{% if redhat_streams_zookeeper_admin_enable_server %} +admin.serverPort={{ redhat_streams_zookeeper_admin_server_port }} {% endif %} # Amount of time to allow followers to connect and sync to the cluster leader. # The time is specified as a number of ticks -initLimit={{ amq_streams_zookeeper_init_limit }} +initLimit={{ redhat_streams_zookeeper_init_limit }} # Amount of time for which followers can be behind the leader. # The time is specified as a number of ticks -syncLimit={{ amq_streams_zookeeper_sync_limit }} +syncLimit={{ redhat_streams_zookeeper_sync_limit }} # List of servers which should be members of the Zookeeper cluster. -{% for zknode in amq_streams_zookeeper_inventory_group %} -server.{% if hostvars[zknode]['amq_streams_zookeeper_zookeeper_id'] is defined -%} -{{ hostvars[zknode]['amq_streams_zookeeper_zookeeper_id'] }} +{% for zknode in redhat_streams_zookeeper_inventory_group %} +server.{% if hostvars[zknode]['redhat_streams_zookeeper_zookeeper_id'] is defined -%} +{{ hostvars[zknode]['redhat_streams_zookeeper_zookeeper_id'] }} {%- else -%} {{ loop.index }} -{%- endif %}={{ zknode }}:{{ amq_streams_zookeeper_cluster_port_start }}:{{ amq_streams_zookeeper_cluster_port_end }}:participant;{{ zknode }}:{{ amq_streams_zookeeper_port }} +{%- endif %}={{ zknode }}:{{ redhat_streams_zookeeper_cluster_port_start }}:{{ redhat_streams_zookeeper_cluster_port_end }}:participant;{{ zknode }}:{{ redhat_streams_zookeeper_port }} {% endfor %} -{% if amq_streams_zookeeper_auth_enabled %} +{% if redhat_streams_zookeeper_auth_enabled %} # Zookeeper Authentication # Server-to-Server Authentication quorum.auth.enableSasl=true