-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use zookeeper from kafka distribution
download everything directly on machine (prepare for different inventories)
- Loading branch information
Showing
27 changed files
with
210 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
[defaults] | ||
inventory = inventories/vbox | ||
host_key_checking = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
kafka_home: "{{ usr_local }}/{{ kafka }}" | ||
kafka_log_dir: "{{ kafka_home }}/logs" | ||
zookeeper_data_dir: "/var/data" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
--- | ||
|
||
- name: copy server.properties {{ kafka_home }}/config/server.properties | ||
become: yes | ||
template: | ||
src: templates/server.properties.j2 | ||
dest: "{{ kafka_home }}/config/server.properties" | ||
notify: "restart kafka" | ||
|
||
- name: copy kafka.environment {{ kafka_home }}/kafka.environment | ||
become: yes | ||
template: | ||
src: templates/kafka.environment.j2 | ||
dest: "{{ kafka_home }}/kafka.environment" | ||
notify: "restart kafka" | ||
|
||
- name: copy zookeeper_client_jaas.conf {{ kafka_home }}/config/zookeeper_client_jaas.conf | ||
become: yes | ||
template: | ||
src: templates/zookeeper_client_jaas.conf.j2 | ||
dest: "{{ kafka_home }}/config/zookeeper_client_jaas.conf" | ||
notify: "restart kafka" | ||
|
||
- name: download {{ prometheus_jmx }} | ||
become: yes | ||
get_url: | ||
url: "{{ prometheus_jmx }}" | ||
dest: "{{ kafka_home }}/prometheus-agent.jar" | ||
|
||
- name: copy prometheus-agent.yml {{ kafka_home }}/config/prometheus_agent.yml | ||
become: yes | ||
template: | ||
src: templates/prometheus_agent.yml.j2 | ||
dest: "{{ kafka_home }}/config/prometheus_agent.yml" | ||
notify: "restart kafka" | ||
|
||
- name: create {{ kafka_log_dir }} | ||
become: yes | ||
file: | ||
path: "{{ kafka_log_dir }}" | ||
state: directory | ||
notify: "restart kafka" | ||
|
||
- name: copy filebeat kafka configs to /etc/filebeat/modules.d/kafka.yml | ||
become: yes | ||
template: | ||
src: templates/filebeat_kafka.yml.j2 | ||
dest: /etc/filebeat/modules.d/kafka.yml | ||
|
||
- name: filebeat enable kafka module | ||
become: yes | ||
command: filebeat modules enable kafka | ||
|
||
- name: copy metricbeat kafka configs to /etc/metricbeat/modules.d/kafka.yml | ||
become: yes | ||
template: | ||
src: templates/metricbeat_kafka.yml.j2 | ||
dest: /etc/metricbeat/modules.d/kafka.yml | ||
|
||
- name: metricbeat modules enable kafka | ||
become: yes | ||
command: metricbeat modules enable kafka | ||
|
||
- name: install kafka systemd unit file | ||
become: yes | ||
template: | ||
src: templates/kafka.service.j2 | ||
dest: "{{ system_units }}/kafka.service" | ||
notify: "restart kafka" | ||
|
||
- name: create {{ exchange }}/client-ssl.properties | ||
become: yes | ||
template: | ||
src: templates/client-ssl.properties.j2 | ||
dest: "{{ ssl_client_dir }}/client-ssl.properties" | ||
when: secure|bool | ||
|
||
- meta: flush_handlers | ||
|
||
- name: allow ClusterAction | ||
shell: "KAFKA_OPTS=-Djava.security.auth.login.config=/usr/local/kafka/config/zookeeper_client_jaas.conf kafka-acls.sh --authorizer-properties zookeeper.connect=localhost:2181 --add --operation ClusterAction --cluster --allow-principal User:CN=kafka,OU=org,O=org,L=home,ST=Bavaria,C=DE" | ||
when: secure|bool and groups.kafka.index(inventory_hostname) == groups.kafka|length - 1 | ||
|
||
- name: allow Describe cluster | ||
shell: "KAFKA_OPTS=-Djava.security.auth.login.config=/usr/local/kafka/config/zookeeper_client_jaas.conf kafka-acls.sh --authorizer-properties zookeeper.connect=localhost:2181 --add --operation Describe --cluster --allow-principal User:CN=kafka,OU=org,O=org,L=home,ST=Bavaria,C=DE" | ||
when: secure|bool and groups.kafka.index(inventory_hostname) == groups.kafka|length - 1 | ||
|
||
- name: allow Describe __consumer_offsets | ||
shell: "KAFKA_OPTS=-Djava.security.auth.login.config=/usr/local/kafka/config/zookeeper_client_jaas.conf /usr/local/kafka/bin/kafka-acls.sh --authorizer-properties zookeeper.connect=localhost:2181 --add --operation Describe --topic __consumer_offsets --allow-principal User:CN=kafka,OU=org,O=org,L=home,ST=Bavaria,C=DE" | ||
when: secure|bool and groups.kafka.index(inventory_hostname) == groups.kafka|length - 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.