Skip to content

Commit

Permalink
plays: add flush_handlers to ensure service is running before post_tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
rpelisse committed Dec 8, 2023
1 parent 133fb27 commit 94b9ca7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
15 changes: 14 additions & 1 deletion playbooks/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@
vars:
amq_streams_common_skip_download: true

Check warning on line 20 in playbooks/playbook.yml

View workflow job for this annotation

GitHub Actions / ci / linter (3.11, 2.15)

var-naming[no-role-prefix]

Variables names from within roles should use amq_streams_broker_ as a prefix. (vars: amq_streams_common_skip_download)

Check warning on line 20 in playbooks/playbook.yml

View workflow job for this annotation

GitHub Actions / ci / linter (3.11, 2.15)

var-naming[no-role-prefix]

Variables names from within roles should use amq_streams_broker_ as a prefix. (vars: amq_streams_common_skip_download)

Check warning on line 20 in playbooks/playbook.yml

View workflow job for this annotation

GitHub Actions / ci / linter (3.11, 2.15)

var-naming[no-role-prefix]

Variables names from within roles should use amq_streams_broker_ as a prefix. (vars: amq_streams_common_skip_download)

Check warning on line 20 in playbooks/playbook.yml

View workflow job for this annotation

GitHub Actions / ci / linter (3.11, 2.15)

var-naming[no-role-prefix]

Variables names from within roles should use amq_streams_broker_ as a prefix. (vars: amq_streams_common_skip_download)

Check warning on line 20 in playbooks/playbook.yml

View workflow job for this annotation

GitHub Actions / ci / linter (3.11, 2.15)

var-naming[no-role-prefix]

Variables names from within roles should use amq_streams_broker_ as a prefix. (vars: amq_streams_common_skip_download)

- name: "Ensure Kafka Connect is running and available."
ansible.builtin.include_role:
name: amq_streams_connect
vars:
connectors:

Check warning on line 26 in playbooks/playbook.yml

View workflow job for this annotation

GitHub Actions / ci / linter (3.11, 2.15)

var-naming[no-role-prefix]

Variables names from within roles should use amq_streams_connect_ as a prefix. (vars: connectors)

Check warning on line 26 in playbooks/playbook.yml

View workflow job for this annotation

GitHub Actions / ci / linter (3.11, 2.15)

var-naming[no-role-prefix]

Variables names from within roles should use amq_streams_connect_ as a prefix. (vars: connectors)

Check warning on line 26 in playbooks/playbook.yml

View workflow job for this annotation

GitHub Actions / ci / linter (3.11, 2.15)

var-naming[no-role-prefix]

Variables names from within roles should use amq_streams_connect_ as a prefix. (vars: connectors)

Check warning on line 26 in playbooks/playbook.yml

View workflow job for this annotation

GitHub Actions / ci / linter (3.11, 2.15)

var-naming[no-role-prefix]

Variables names from within roles should use amq_streams_connect_ as a prefix. (vars: connectors)

Check warning on line 26 in playbooks/playbook.yml

View workflow job for this annotation

GitHub Actions / ci / linter (3.11, 2.15)

var-naming[no-role-prefix]

Variables names from within roles should use amq_streams_connect_ as a prefix. (vars: connectors)
- { name: "file", path: "connectors/file.yml" }
- name: "Give a rest to the target, sometimes broker takes a while to start"
ansible.builtin.wait_for:
timeout: 60

- name: "Flush all handlers to be sure services are ready for post_tasks."
ansible.builtin.meta: flush_handlers
post_tasks:
- name: "Ensures topics exist."
ansible.builtin.include_role:
name: amq_streams_broker
Expand Down Expand Up @@ -57,7 +70,7 @@
vars:
connectors:
- { name: "file", path: "connectors/file.yml" }
post_tasks:

- name: "Display numbers of Zookeeper instances managed by Ansible."
ansible.builtin.debug:
msg: "Numbers of Zookeeper instances: {{ amq_streams_zookeeper_instance_count }}."
Expand Down
8 changes: 1 addition & 7 deletions playbooks/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,20 @@
ansible.builtin.include_role:
name: "amq_streams_zookeeper"
tasks_from: validate.yml
when:
- amq_streams_zookeeper_enabled is defined and amq_streams_zookeeper_enabled

- name: "Validate Broker installation on target"
ansible.builtin.include_role:
name: "amq_streams_broker"
tasks_from: validate.yml
when:
- amq_streams_broker_enabled

- name: "Validate Kafka Connect installation on target"
ansible.builtin.include_role:
name: "amq_streams_connect"
tasks_from: validate.yml
when:
- amq_streams_connect_enabled

- name: "Validate Cruise Control installation on target"
ansible.builtin.include_role:
name: "amq_streams_cruise_control"
tasks_from: validate.yml
when:
- amq_streams_connect_enabled
- amq_streams_cruise_control_enabled is defined and amq_streams_cruise_control_enabled
3 changes: 0 additions & 3 deletions roles/amq_streams_cruise_control/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@
- amq_streams_firewalld_enabled is defined and amq_streams_firewalld_enabled
- amq_streams_cruise_control_port is defined




- name: "Deploy Cruise Control as a systemd service."
ansible.builtin.include_role:
name: amq_streams_common
Expand Down

0 comments on commit 94b9ca7

Please sign in to comment.