Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Val play #110

Merged
merged 8 commits into from
Dec 8, 2023
Merged
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
15 changes: 14 additions & 1 deletion playbooks/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,21 @@
ansible.builtin.include_role:
name: amq_streams_broker
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)

- 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)
- { 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
24 changes: 21 additions & 3 deletions playbooks/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@
- name: "Validate correctness of AMQ Streams install"
hosts: all
tasks:
- name: "TODO Implement validation tasks"
ansible.builtin.debug:
msg: "TODO"
- name: "Validate Zookeeper installation on target"
ansible.builtin.include_role:
name: "amq_streams_zookeeper"
tasks_from: validate.yml

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

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

- name: "Validate Cruise Control installation on target"
ansible.builtin.include_role:
name: "amq_streams_cruise_control"
tasks_from: validate.yml
when:
- amq_streams_cruise_control_enabled is defined and amq_streams_cruise_control_enabled
2 changes: 1 addition & 1 deletion roles/amq_streams_broker/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ galaxy_info:

license: Apache License 2.0

min_ansible_version: "2.12"
min_ansible_version: "2.14"

platforms:
- name: EL
Expand Down
3 changes: 1 addition & 2 deletions roles/amq_streams_common/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ amq_streams_common_download_dir: /tmp
amq_streams_common_download_user: "{{ amq_streams_common_user | default(omit) }}"
amq_streams_common_download_group: "{{ amq_streams_common_group | default(omit) }}"
amq_streams_common_install_dir: /opt
amq_streams_common_offline_install: false
amq_streams_common_path_to_archive_file: "{{ amq_streams_common_download_dir }}/{{ amq_streams_common_archive_file }}"
amq_streams_common_download_node: localhost
amq_streams_common_systctl_update_enabled: false
Expand All @@ -28,8 +29,6 @@ amq_streams_common_firewalld_package_name:
- firewalld
amq_streams_common_firewalld_enabled: false

amq_streams_common_offline_install: false

amq_streams_common_prometheus_install_rpm: True
amq_streams_common_prometheus_package_name: 'prometheus-jmx-exporter'
amq_streams_common_prometheus_path_to_jar: /usr/share/java/prometheus-jmx-exporter
Expand Down
26 changes: 26 additions & 0 deletions roles/amq_streams_common/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
collections:
- middleware_automation.common

galaxy_info:
role_name: amq_streams_common
namespace: middleware_automation
author: Romain Pelisse
description: AMQ Streams common plays
company: Red Hat, Inc.

license: Apache License 2.0

min_ansible_version: "2.14"

platforms:
- name: EL
versions:
- 8

galaxy_tags:
- java
- jboss
- wildfly
- cli
- server
2 changes: 1 addition & 1 deletion roles/amq_streams_connect/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ galaxy_info:

license: Apache License 2.0

min_ansible_version: "2.12"
min_ansible_version: "2.14"

platforms:
- name: EL
Expand Down
1 change: 1 addition & 0 deletions roles/amq_streams_cruise_control/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
amq_streams_cruise_control_enabled: false
amq_streams_cruise_control_home: /opt/cruise-control/
rhn_product_archive_file_pattern: '^.*/amq-streams-[0-9.]*-cruise-control-bin.zip'
amq_streams_cruise_control_service_name: amq_streams_cruise_control
Expand Down
2 changes: 1 addition & 1 deletion roles/amq_streams_cruise_control/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ galaxy_info:

license: Apache License 2.0

min_ansible_version: "2.12"
min_ansible_version: "2.14"

platforms:
- name: EL
Expand Down
10 changes: 9 additions & 1 deletion roles/amq_streams_cruise_control/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,15 @@
when:
- amq_streams_broker_inter_broker_auth_sasl_protocol is defined and amq_streams_broker_inter_broker_auth_sasl_mechanisms is defined and amq_streams_cruise_control_zk_sasl_jaas_config is defined

#TODO: Deal with FW if enabled
- name: "Configure firewalld for Cruise Control (if enable)."
ansible.builtin.include_role:
name: amq_streams_common
tasks_from: firewalld.yml
vars:
service_port: "{{ amq_streams_cruise_control_port }}"
when:
- 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:
Expand Down
4 changes: 4 additions & 0 deletions roles/amq_streams_cruise_control/tasks/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- name: "TODO implement validation play for Cruise Control"
ansible.builtin.debug:
msg: "Need to be implemented."
2 changes: 1 addition & 1 deletion roles/amq_streams_zookeeper/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ amq_streams_zookeeper_group: 'amq_streams'
amq_streams_zookeeper_service_name: 'amq_streams_zookeeper'
amq_streams_zookeeper_service_config_template: 'templates/service.conf.j2'
amq_streams_zookeeper_service_env_file: '/etc/zookeeper.conf'
amq_streams_zookeeper_data_dir: /var/lib/{{ amq_streams_zookeeper_service_name }}/
amq_streams_zookeeper_data_dir: "/var/lib/{{ amq_streams_zookeeper_service_name }}/"
amq_streams_zookeeper_logs_dir: "/var/log/{{ amq_streams_zookeeper_service_name }}/"
amq_streams_zookeeper_max_client_cnxns: 0
amq_streams_zookeeper_admin_enable_server: 'true'
Expand Down
2 changes: 1 addition & 1 deletion roles/amq_streams_zookeeper/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ galaxy_info:

license: Apache License 2.0

min_ansible_version: "2.12"
min_ansible_version: "2.14"

platforms:
- name: EL
Expand Down
2 changes: 1 addition & 1 deletion roles/amq_streams_zookeeper/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@
when:
- amq_streams_zookeeper_auth_enabled is defined and amq_streams_zookeeper_auth_enabled

- name: "Configure firewalld for Zookeeper (if enable)."
- name: "Configure Zookeeper as a systemd service."
ansible.builtin.include_tasks: service.yml
Loading