Skip to content

Commit

Permalink
Add a wait stmt to allow user to wait for Zookeeper to be active, bef…
Browse files Browse the repository at this point in the history
…ore starting broker
  • Loading branch information
rpelisse committed Oct 10, 2023
1 parent fe78895 commit 77c4577
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions roles/amq_streams_broker/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ amq_streams_broker_instance_count: "{{ groups[amq_streams_broker_inventory_group

amq_streams_deployment_balance_check_enabled: true

amq_streams_broker_zookeeper_host_default_value: localhost
amq_streams_broker_zookeeper_host_default_value: "{{ groups['zookeepers'][0] | default('localhost') }}"
amq_streams_broker_zookeeper_port_default_value: 2181
amq_streams_broker_zookeeper_wait: True
amq_streams_broker_zookeeper_wait: False

# Broker-Zookeeper Authentication with SASL
amq_streams_zookeeper_auth_enabled: false
Expand Down
5 changes: 2 additions & 3 deletions roles/amq_streams_broker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,14 @@
when:
- amq_streams_zookeeper_auth_enabled is defined and amq_streams_zookeeper_auth_enabled

- name: "Wait for Zookeeper to be available - if host and port are provided."
- name: "Wait for Zookeeper to be available - if enabled ({{ amq_streams_broker_zookeeper_host }}:{{ amq_streams_broker_zookeeper_port }})."
ansible.builtin.wait_for:
host: "{{ amq_streams_broker_zookeeper_host }}"
port: "{{ amq_streams_broker_zookeeper_port }}"
when:
- 0 > 1 # Disabled until find a way to test the Zookeeper cluster connection (including all the zknodes)
- amq_streams_broker_zookeeper_wait is defined and amq_streams_broker_zookeeper_wait
- amq_streams_broker_zookeeper_host is defined
- amq_streams_broker_zookeeper_port is defined
- amq_streams_broker_zookeeper_wait is defined and amq_streams_broker_zookeeper_wait

- name: "Copy Server Keystore with certificates"
ansible.builtin.copy:
Expand Down

0 comments on commit 77c4577

Please sign in to comment.