-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
696 additions
and
601 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,158 @@ | ||
--- | ||
- import_playbook: ../../playbooks/amq_streams_all_auth.yml | ||
- name: "Ansible Playbook to install Zookeeper and Broker with Authentication" | ||
hosts: all | ||
vars: | ||
amq_streams_common_download_dir: /tmp/ | ||
# Enabling Zookeeper Authentication | ||
amq_streams_zookeeper_auth_enabled: true | ||
amq_streams_zookeeper_auth_user: zkadmin | ||
amq_streams_zookeeper_auth_pass: p@ssw0rd | ||
|
||
# Enabling Kafka Broker Listeners | ||
amq_streams_broker_listeners: | ||
- AUTHENTICATED://:{{ amq_streams_broker_listener_port }} | ||
- REPLICATION://:{{ amq_streams_broker_listener_internal_port }} | ||
|
||
# Listener for inter-broker communications | ||
amq_streams_broker_inter_broker_listener: REPLICATION | ||
|
||
# Enabling Kafka Broker Authentication | ||
amq_streams_broker_auth_enabled: true | ||
amq_streams_broker_auth_scram_enabled: true | ||
amq_streams_broker_auth_listeners: | ||
- AUTHENTICATED:SASL_PLAINTEXT | ||
- REPLICATION:PLAINTEXT | ||
|
||
amq_streams_broker_auth_sasl_mechanisms: | ||
- PLAIN | ||
- SCRAM-SHA-512 | ||
|
||
# Kafka Plain Users | ||
amq_streams_broker_auth_plain_users: | ||
- username: admin | ||
password: p@ssw0rd | ||
- username: kafkauser01 | ||
password: p@ssw0rd | ||
- username: kafkauser02 | ||
password: p@ssw0rd | ||
|
||
# Kafka SCRAM Users | ||
amq_streams_broker_auth_scram_users: | ||
- username: kafkascramuser01 | ||
password: p@ssw0rd | ||
- username: kafkascramuser02 | ||
password: p@ssw0rd | ||
|
||
# Defining default Kafka user for administrative tasks | ||
amq_streams_broker_admin_mechanism: PLAIN | ||
#amq_streams_broker_admin_mechanism: SCRAM-SHA-512 | ||
amq_streams_broker_admin_username: admin | ||
amq_streams_broker_admin_password: p@ssw0rd | ||
|
||
# Topic Management | ||
amq_streams_broker_topics: | ||
- name: sampleTopic | ||
partitions: 1 | ||
replication_factor: 1 | ||
- name: otherTopic | ||
partitions: 1 | ||
replication_factor: 1 | ||
roles: | ||
- role: amq_streams_zookeeper | ||
tasks: | ||
- name: "Ensure Zookeeper is running and available." | ||
ansible.builtin.include_role: | ||
name: amq_streams_zookeeper | ||
vars: | ||
amq_streams_common_skip_download: true | ||
|
||
- name: "Ensure Broker is running and available." | ||
ansible.builtin.include_role: | ||
name: amq_streams_broker | ||
vars: | ||
amq_streams_common_skip_download: true | ||
|
||
- name: "Create topics" | ||
ansible.builtin.include_role: | ||
name: amq_streams_broker | ||
tasks_from: topic/create.yml | ||
loop: "{{ amq_streams_broker_topics }}" | ||
loop_control: | ||
loop_var: topic | ||
vars: | ||
topic_name: "{{ topic.name }}" | ||
topic_partitions: "{{ topic.partitions }}" | ||
topic_replication_factor: "{{ topic.replication_factor }}" | ||
|
||
- name: "Describe topics" | ||
ansible.builtin.include_role: | ||
name: amq_streams_broker | ||
tasks_from: topic/describe.yml | ||
loop: "{{ amq_streams_broker_topics }}" | ||
loop_control: | ||
loop_var: topic | ||
vars: | ||
topic_name: "{{ topic.name }}" | ||
|
||
- name: "Delete topics" | ||
ansible.builtin.include_role: | ||
name: amq_streams_broker | ||
tasks_from: topic/delete.yml | ||
loop: "{{ amq_streams_broker_topics }}" | ||
loop_control: | ||
loop_var: topic | ||
vars: | ||
topic_name: "{{ topic.name }}" | ||
|
||
- name: "Create SCRAM users" | ||
ansible.builtin.include_role: | ||
name: amq_streams_broker | ||
tasks_from: user-scram/create.yml | ||
loop: "{{ amq_streams_broker_auth_scram_users }}" | ||
loop_control: | ||
loop_var: user | ||
vars: | ||
user_username: "{{ user.username }}" | ||
user_password: "{{ user.password }}" | ||
|
||
- name: "Describe SCRAM users" | ||
ansible.builtin.include_role: | ||
name: amq_streams_broker | ||
tasks_from: user-scram/describe.yml | ||
loop: "{{ amq_streams_broker_auth_scram_users }}" | ||
loop_control: | ||
loop_var: user | ||
vars: | ||
user_username: "{{ user.username }}" | ||
|
||
- name: "Delete SCRAM users" | ||
ansible.builtin.include_role: | ||
name: amq_streams_broker | ||
tasks_from: user-scram/delete.yml | ||
loop: "{{ amq_streams_broker_auth_scram_users }}" | ||
loop_control: | ||
loop_var: user | ||
vars: | ||
user_username: "{{ user.username }}" | ||
|
||
post_tasks: | ||
- name: "Display numbers of Zookeeper instances managed by Ansible." | ||
ansible.builtin.debug: | ||
msg: "Numbers of Zookeeper instances: {{ amq_streams_zookeeper_instance_count }}." | ||
when: | ||
- amq_streams_zookeeper_instance_count_enabled is defined and amq_streams_zookeeper_instance_count_enabled | ||
|
||
- name: "Display numbers of broker instances managed by Ansible:" | ||
ansible.builtin.debug: | ||
msg: "Numbers of broker instances: {{ amq_streams_broker_instance_count }}." | ||
when: | ||
- amq_streams_broker_instance_count_enabled is defined and amq_streams_broker_instance_count_enabled | ||
|
||
- name: "Validate that Zookeeper deployment is functional." | ||
ansible.builtin.include_role: | ||
name: amq_streams_zookeeper | ||
tasks_from: validate.yml | ||
|
||
- name: "Validate that Broker deployment is functional." | ||
ansible.builtin.include_role: | ||
name: amq_streams_broker | ||
tasks_from: validate.yml |
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,4 +1,64 @@ | ||
--- | ||
- import_playbook: ../../playbooks/amq_streams_all_cluster.yml | ||
- name: "Ansible Playbook to install a Kafka cluster (+Zookeeper)" | ||
hosts: all | ||
vars: | ||
amq_streams_common_download_dir: /tmp/ | ||
amq_streams_common_download_node: "" | ||
amq_streams_common_download_dir: "/tmp" | ||
|
||
# Topic Management | ||
amq_streams_broker_topics: | ||
- name: myTopic | ||
partitions: 1 | ||
replication_factor: 1 | ||
roles: | ||
- role: amq_streams_zookeeper | ||
tasks: | ||
- name: "Ensure AMQ Streams Broker is running and available." | ||
ansible.builtin.include_role: | ||
name: amq_streams_broker | ||
vars: | ||
amq_streams_common_skip_download: true | ||
|
||
- name: "Create topics" | ||
ansible.builtin.include_role: | ||
name: amq_streams_broker | ||
tasks_from: topic/create.yml | ||
loop: "{{ amq_streams_broker_topics }}" | ||
loop_control: | ||
loop_var: topic | ||
vars: | ||
topic_name: "{{ topic.name }}" | ||
topic_partitions: "{{ topic.partitions }}" | ||
topic_replication_factor: "{{ topic.replication_factor }}" | ||
|
||
- name: "Describe topics" | ||
ansible.builtin.include_role: | ||
name: amq_streams_broker | ||
tasks_from: topic/describe.yml | ||
loop: "{{ amq_streams_broker_topics }}" | ||
loop_control: | ||
loop_var: topic | ||
vars: | ||
topic_name: "{{ topic.name }}" | ||
post_tasks: | ||
- name: "Display numbers of Zookeeper instances managed by Ansible." | ||
ansible.builtin.debug: | ||
msg: "Numbers of Zookeeper instances: {{ amq_streams_zookeeper_instance_count }}." | ||
when: | ||
- amq_streams_zookeeper_instance_count_enabled is defined and amq_streams_zookeeper_instance_count_enabled | ||
|
||
- name: "Display numbers of broker instances managed by Ansible." | ||
ansible.builtin.debug: | ||
msg: "Numbers of broker instances: {{ amq_streams_broker_instance_count }}." | ||
when: | ||
- amq_streams_broker_instance_count_enabled is defined and amq_streams_broker_instance_count_enabled | ||
|
||
- name: "Validate that Broker deployment is functional." | ||
ansible.builtin.include_role: | ||
name: amq_streams_broker | ||
tasks_from: validate.yml | ||
|
||
- name: "Validate that deployment is functional." | ||
ansible.builtin.include_role: | ||
name: amq_streams_zookeeper | ||
tasks_from: validate.yml |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
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,4 +1,10 @@ | ||
--- | ||
- import_playbook: ../../playbooks/amq_streams_connect.yml | ||
vars: | ||
amq_streams_common_download_dir: /tmp/ | ||
- name: "Ansible playbook to install a Kafka Connect cluster" | ||
hosts: all | ||
tasks: | ||
- name: "Ensure Kafka Connect is running and available." | ||
ansible.builtin.include_role: | ||
name: amq_streams_connect | ||
vars: | ||
connectors: | ||
- { name: "file", path: "connectors/file.yml" } |
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,4 +1,86 @@ | ||
--- | ||
- import_playbook: ../../playbooks/playbook.yml | ||
- name: "Automate AMQ Streams install" | ||
hosts: all | ||
vars: | ||
amq_streams_common_download_dir: /tmp/ | ||
# Topic Management | ||
amq_streams_broker_topics: | ||
- name: sampleTopic | ||
partitions: 2 | ||
replication_factor: 1 | ||
- name: otherTopic | ||
partitions: 4 | ||
replication_factor: 1 | ||
roles: | ||
- role: amq_streams_zookeeper | ||
tasks: | ||
- name: "Ensure AMQ Streams Broker is running and available." | ||
ansible.builtin.include_role: | ||
name: amq_streams_broker | ||
vars: | ||
amq_streams_common_skip_download: true | ||
|
||
- name: "Ensures topics exist." | ||
ansible.builtin.include_role: | ||
name: amq_streams_broker | ||
tasks_from: topic/create.yml | ||
loop: "{{ amq_streams_broker_topics }}" | ||
loop_control: | ||
loop_var: topic | ||
vars: | ||
topic_name: "{{ topic.name }}" | ||
topic_partitions: "{{ topic.partitions }}" | ||
topic_replication_factor: "{{ topic.replication_factor }}" | ||
|
||
- name: "Describe created topic." | ||
ansible.builtin.include_role: | ||
name: amq_streams_broker | ||
tasks_from: topic/describe.yml | ||
loop: "{{ amq_streams_broker_topics }}" | ||
loop_control: | ||
loop_var: topic | ||
vars: | ||
topic_name: "{{ topic.name }}" | ||
|
||
- name: "Delete topics" | ||
ansible.builtin.include_role: | ||
name: amq_streams_broker | ||
tasks_from: topic/delete.yml | ||
loop: "{{ amq_streams_broker_topics }}" | ||
loop_control: | ||
loop_var: topic | ||
vars: | ||
topic_name: "{{ topic.name }}" | ||
|
||
- name: "Ensure AMQ Streams Connect is running and available." | ||
ansible.builtin.include_role: | ||
name: amq_streams_connect | ||
vars: | ||
connectors: | ||
- { name: "file", path: "connectors/file.yml" } | ||
post_tasks: | ||
- name: "Display numbers of Zookeeper instances managed by Ansible." | ||
ansible.builtin.debug: | ||
msg: "Numbers of Zookeeper instances: {{ amq_streams_zookeeper_instance_count }}." | ||
when: | ||
- amq_streams_zookeeper_instance_count_enabled is defined and amq_streams_zookeeper_instance_count_enabled | ||
|
||
- name: "Display numbers of broker instances managed by Ansible." | ||
ansible.builtin.debug: | ||
msg: "Numbers of broker instances: {{ amq_streams_broker_instance_count }}." | ||
when: | ||
- amq_streams_broker_instance_count_enabled is defined and amq_streams_broker_instance_count_enabled | ||
|
||
- name: "Validate that deployment is functional." | ||
ansible.builtin.include_role: | ||
name: amq_streams_zookeeper | ||
tasks_from: validate.yml | ||
|
||
- name: "Validate that Broker deployment is functional." | ||
ansible.builtin.include_role: | ||
name: amq_streams_broker | ||
tasks_from: validate.yml | ||
|
||
- name: "Validate that Connect deployment is functional." | ||
ansible.builtin.include_role: | ||
name: amq_streams_connect | ||
tasks_from: validate.yml |
Oops, something went wrong.