-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a2d7db
commit 5910f6a
Showing
8 changed files
with
227 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
gather_facts: yes | ||
vars: | ||
activemq_cluster_enabled: false | ||
activemq_ha_enabled: false | ||
activemq_shared_storage: false | ||
activemq_replication: false | ||
activemq_scale_down_enabled: false | ||
activemq_configure_firewalld: false | ||
activemq_systemd_wait_for_log: false | ||
activemq_systemd_wait_for_port: true | ||
activemq_cluster_discovery: "provided" | ||
activemq_nio_enabled: true | ||
activemq_cors_strict_checking: false | ||
activemq_prometheus_enabled: false | ||
activemq_acceptors: | ||
- name: "{{ inventory_hostname }}" | ||
bind_address: 0.0.0.0 | ||
bind_port: "{{ activemq_port }}" | ||
parameters: | ||
tcpSendBufferSize: 1048576 | ||
tcpReceiveBufferSize: 1048576 | ||
protocols: CORE,AMQP | ||
useEpoll: true | ||
sslEnabled: false | ||
activemq_connectors: | ||
- name: instance1 | ||
address: instance1 | ||
- name: instance2 | ||
address: instance2 | ||
activemq_addresses: | ||
- name: queue.in | ||
anycast: | ||
- name: queue.in | ||
- name: queue.out | ||
anycast: | ||
- name: queue.out | ||
- name: DLQ | ||
anycast: | ||
- name: DLQ | ||
parameters: | ||
durable: True | ||
- name: ExpiryQueue | ||
anycast: | ||
- name: ExpiryQueue | ||
- name: a.test | ||
anycast: | ||
- name: a.test | ||
- name: b.test | ||
anycast: | ||
- name: b.test | ||
parameters: | ||
max_consumers: 1 | ||
delay_before_dispatch: 3 | ||
roles: | ||
- middleware_automation.amq.activemq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
--- | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: instance1 | ||
image: registry.access.redhat.com/ubi9/ubi-init:latest | ||
pre_build_image: true | ||
privileged: true | ||
command: "/usr/sbin/init" | ||
networks: | ||
- name: amq | ||
tmpfs: | ||
- /run | ||
- /tmp | ||
- name: instance2 | ||
image: registry.access.redhat.com/ubi9/ubi-init:latest | ||
pre_build_image: true | ||
privileged: true | ||
command: "/usr/sbin/init" | ||
networks: | ||
- name: amq | ||
tmpfs: | ||
- /run | ||
- /tmp | ||
provisioner: | ||
name: ansible | ||
config_options: | ||
defaults: | ||
interpreter_python: auto_silent | ||
ssh_connection: | ||
pipelining: false | ||
playbooks: | ||
prepare: prepare.yml | ||
converge: converge.yml | ||
verify: verify.yml | ||
inventory: | ||
host_vars: | ||
localhost: | ||
ansible_python_interpreter: "{{ ansible_playbook_python }}" | ||
instance1: | ||
amq_broker_federations: | ||
- name: amq1-federation | ||
upstreams: | ||
- name: instance2 | ||
user: amq-broker | ||
password: amq-broker | ||
static_connectors: | ||
- instance2 | ||
queue_policies: | ||
- name: TEST | ||
includes: | ||
- queue_match: TEST | ||
address_match: TEST | ||
instance2: | ||
amq_broker_federations: | ||
- name: amq2-federation | ||
upstreams: | ||
- name: instance1 | ||
user: amq-broker | ||
password: amq-broker | ||
static_connectors: | ||
- instance1 | ||
queue_policies: | ||
- name: TEST | ||
includes: | ||
- queue_match: TEST | ||
address_match: TEST | ||
env: | ||
ANSIBLE_FORCE_COLOR: "true" | ||
verifier: | ||
name: ansible | ||
scenario: | ||
test_sequence: | ||
- cleanup | ||
- destroy | ||
- create | ||
- prepare | ||
- converge | ||
- idempotence | ||
- side_effect | ||
- verify | ||
- cleanup | ||
- destroy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
- name: Prepare | ||
hosts: all | ||
tasks: | ||
- name: "Run preparation common to all scenario" | ||
ansible.builtin.include_tasks: ../prepare.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../roles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
tasks: | ||
- name: Populate service facts | ||
ansible.builtin.service_facts: | ||
|
||
- name: Populate activemq facts | ||
middleware_automation.amq.activemq_facts: | ||
base_url: http://localhost:8161 | ||
auth_username: amq-broker | ||
auth_password: amq-broker | ||
validate_certs: false | ||
|
||
- name: Check if amq-broker service is started | ||
ansible.builtin.assert: | ||
that: | ||
- ansible_facts.services["amq-broker.service"]["state"] == "running" | ||
- ansible_facts.services["amq-broker.service"]["status"] == "enabled" | ||
|
||
- name: Read content of instance1 logs | ||
ansible.builtin.slurp: | ||
src: /var/log/activemq/amq-broker/artemis.log | ||
register: slurped_log_instance1 | ||
delegate_to: instance1 | ||
run_once: true | ||
no_log: true | ||
|
||
- name: Read content of instance2 logs | ||
ansible.builtin.slurp: | ||
src: /var/log/activemq/amq-broker/artemis.log | ||
register: slurped_log_instance2 | ||
delegate_to: instance2 | ||
run_once: true | ||
no_log: true | ||
|
||
- name: Check cluster status | ||
run_once: true | ||
block: | ||
- name: Check live-only on instance1 | ||
ansible.builtin.assert: | ||
that: | ||
- "'live Message Broker is starting' in slurped_log_instance1.content|b64decode or 'Primary message broker is starting' in slurped_log_instance1.content|b64decode" | ||
quiet: true | ||
- name: Check live-only on instance2 | ||
ansible.builtin.assert: | ||
that: | ||
- "'live message broker is starting' in slurped_log_instance2.content|b64decode or 'Primary message broker is starting' in slurped_log_instance2.content|b64decode" | ||
quiet: true | ||
|
||
- name: Check cluster status via jolokia facts (master) | ||
ansible.builtin.assert: | ||
that: | ||
- ansible_facts.activemq.Active == true | ||
- ansible_facts.activemq.Backup == false | ||
- ansible_facts.activemq.Clustered == false | ||
- ansible_facts.activemq.SharedStore == false | ||
- ansible_facts.activemq.HAPolicy == "Primary Only" | ||
when: inventory_hostname == 'instance1' | ||
|
||
- name: Check cluster status via jolokia facts | ||
ansible.builtin.assert: | ||
that: | ||
- ansible_facts.activemq.Active == true | ||
- ansible_facts.activemq.Backup == false | ||
- ansible_facts.activemq.Clustered == false | ||
- ansible_facts.activemq.SharedStore == false | ||
- ansible_facts.activemq.HAPolicy == "Primary Only" | ||
when: inventory_hostname == 'instance2' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters