Skip to content

Commit

Permalink
💚 Update topic management in test playbooks
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarting authored and rpelisse committed Jul 26, 2023
1 parent 6119d68 commit 2c2df58
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 12 deletions.
26 changes: 20 additions & 6 deletions playbooks/amq_streams_all_cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
vars:
amq_streams_common_download_node: ""
amq_streams_common_download_dir: "/tmp"
topic_name: myTopic

# Topic Management
amq_streams_broker_topics:
- name: myTopic
partitions: 1
replication_factor: 1
roles:
- role: amq_streams_zookeeper
tasks:
Expand All @@ -14,18 +19,27 @@
vars:
amq_streams_common_skip_download: true

- name: "Ensures topic {{ topic_name }} exist."
- name: "Create topics"
ansible.builtin.include_role:
name: amq_streams_broker
tasks_from: topic/create.yml
loop:
- { name: monTopic, partition: 3 }
- { name: topic2, partition: 2 }
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."
- 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:
Expand Down
25 changes: 19 additions & 6 deletions playbooks/amq_streams_distributed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
amq_streams_common_download_dir: "/tmp"
amq_streams_zookeeper_auth_user: amq_streams_user
amq_streams_zookeeper_auth_pass: amq_streams_pass
topic_name: myTopic
# Topic Management
amq_streams_broker_topics:
- name: myTopic
partitions: 1
replication_factor: 1
roles:
- role: amq_streams_broker
tasks:
Expand All @@ -34,18 +38,27 @@
vars:
amq_streams_common_skip_download: true

- name: "Ensures topic {{ topic_name }} exist."
- name: "Create topics"
ansible.builtin.include_role:
name: amq_streams_broker
tasks_from: topic/create.yml
loop:
- { name: monTopic, partition: 3 }
- { name: topic2, partition: 2 }
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."
- 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 broker instances managed by Ansible."
ansible.builtin.debug:
Expand Down

0 comments on commit 2c2df58

Please sign in to comment.