Skip to content

Commit

Permalink
[ANSIENG-2966] | Add precheck for Kraft Controller port availability
Browse files Browse the repository at this point in the history
  • Loading branch information
mansisinha committed Jan 25, 2024
1 parent 30bed1f commit 574d3cd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions playbooks/migration_precheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
hosts: localhost
gather_facts: false
tasks:
- import_role:
name: variables

- name: Check the presence of Controller in the inventory file
fail:
msg: "Please add Kraft Controller hosts in the inventory file for migration."
Expand All @@ -21,6 +24,18 @@
when:
- not (kraft_migration | default(false) | bool)

- name: Get List of Kafka Broker listeners' ports
set_fact:
kafka_broker_ports: "{% for listener in kafka_broker_listeners|dict2items %}{% if loop.index > 1%},{% endif %}{{ listener['value']['port'] }}{% endfor %}"

- name: Check Kraft port in colocated Migration
fail:
msg: "Port {{kafka_controller_port}} is already occupied for {{item}}, Please use a different port for Kraft Controller."
when:
- item in groups.kafka_broker
- kafka_controller_port|string in kafka_broker_ports.split(',')
loop: "{{ groups.kafka_controller }}"

- name: Check Current Confluent Version
hosts: zookeeper,kafka_broker
gather_facts: false
Expand Down

0 comments on commit 574d3cd

Please sign in to comment.