Skip to content

Commit

Permalink
feat: support managing firewall rules
Browse files Browse the repository at this point in the history
fix: port

fix: syntax

fix: RHEL not RedHat

fix: make immediate
  • Loading branch information
ryanfaircloth committed Dec 5, 2024
1 parent 71a82b0 commit 8cc75f8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ kafka_version: 3.8.0
kafka_scala_version: 2.13
kafka_java_version: 17
kafka_install_dependencies: false
kafka_firewall_add_rules: false

kafka_open_file_limit: 800000
# if kafka_checksum is defined role will use that value instead getting checksum from kafka downloads page
# kafka_checksum: >
Expand Down
16 changes: 16 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,22 @@
create: true
notify: Restart Kafka

- name: Allow Firewall Controller Traffic
ansible.posix.firewalld:
port: 9093/tcp
permanent: true
state: enabled
immediate: true
when: "kafka_firewall_add_rules and ansible_os_family == 'RedHat' and 'controller' in (hostvars[item]['kafka_node_roles'] | default(kafka_node_roles))"

- name: Allow Firewall Broker Traffic
ansible.posix.firewalld:
port: 9092/tcp
permanent: true
state: enabled
immediate: true
when: "kafka_firewall_add_rules and ansible_os_family == 'RedHat' and 'broker' in (hostvars[item]['kafka_node_roles'] | default(kafka_node_roles))"

- name: Install Kafka service definition
become: true
ansible.builtin.template:
Expand Down

0 comments on commit 8cc75f8

Please sign in to comment.