Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/manual-kafka-cluster/collections.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ collections:
- name: community.crypto
version: 2.15.1
- name: linode.cloud
version: 0.16.1
version: 0.37.1
- name: community.general
version: 8.6.0
version: 8.6.0
3 changes: 2 additions & 1 deletion apps/manual-kafka-cluster/group_vars/kafka/vars
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ region: us-southeast
image: linode/ubuntu24.04
group:
linode_tags:
firewall_label:

cluster_size: 3
client_count: 2
Expand All @@ -26,4 +27,4 @@ state_or_province_name: Pennsylvania
locality_name: Philadelphia
organization_name: Akamai Technologies
email_address: [email protected]
ca_common_name: Kafka RootCA
ca_common_name: Kafka RootCA
14 changes: 12 additions & 2 deletions apps/manual-kafka-cluster/provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@

tasks:

- name: get firewall info
# https://galaxy.ansible.com/ui/repo/published/linode/cloud/content/module/firewall_info/
linode.cloud.firewall_info:
label: '{{ firewall_label }}'
api_token: '{{ api_token }}'
register: firewall_info
when: firewall_label|d(False)

- name: creating kafka servers
# https://galaxy.ansible.com/ui/repo/published/linode/cloud/content/module/instance/
linode.cloud.instance:
label: '{{ instance_prefix }}{{ item }}'
api_token: '{{ api_token }}'
Expand All @@ -21,6 +30,7 @@
ua_prefix: 'docs-kafka-occ'
tags: '{{ linode_tags }}'
state: present
firewall_id: '{{ (firewall_info.firewall|default({})).id|default(omit) }}'
with_sequence: count='{{ cluster_size }}'

- name: get info about the instances
Expand Down Expand Up @@ -54,13 +64,13 @@
#jinja2: trim_blocks:False
[kafka]
{%- for count in range(cluster_size) %}
{{ info.results[count].instance.ipv4[0] }} {% if count < controller_count %}role='controller and broker'{%else%}role='broker only'{%endif%}
{{ info.results[count].networking.ipv4.public[0].rdns }} {% if count < controller_count %}role='controller and broker'{%else%}role='broker only'{%endif%}
{%- endfor %}

- name: wait for port 22 to become open
wait_for:
port: 22
host: '{{ item.instance.ipv4[0] }}'
host: '{{ item.networking.ipv4.public[0].rdns }}'
search_regex: OpenSSH
delay: 10
connection: local
Expand Down
2 changes: 1 addition & 1 deletion apps/manual-kafka-cluster/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ pyyaml==6.0.1
dnspython==2.2.1
passlib==1.7.4
## cloud.linode module dependancies ##
linode-api4==5.15.1
linode-api4==5.29.0
polling==0.3.2
ansible-specdoc==0.0.14