Skip to content

Commit

Permalink
Add a molecule scenario for all_cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
rpelisse committed Aug 8, 2023
1 parent fd06e8b commit d6b7aa1
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 0 deletions.
4 changes: 4 additions & 0 deletions molecule/all_cluster/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- import_playbook: ../../playbooks/amq_streams_all_cluster.yml
vars:
amq_streams_common_download_dir: /tmp/
45 changes: 45 additions & 0 deletions molecule/all_cluster/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
driver:
name: docker
platforms:
- name: instance
image: registry.access.redhat.com/ubi8/ubi-init:latest
pre_build_image: true
privileged: true
command: "/usr/sbin/init"
groups:
- zookeepers
- brokers
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 }}"
env:
ANSIBLE_FORCE_COLOR: "true"
verifier:
name: ansible
scenario:
test_sequence:
- dependency
- cleanup
- destroy
- syntax
- create
- prepare
- converge
- idempotence
- side_effect
- verify
- cleanup
- destroy
10 changes: 10 additions & 0 deletions molecule/all_cluster/prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- name: Prepare
hosts: all
tasks:

- name: "Ensure required packages are installed."
ansible.builtin.yum:
name:
- sudo
state: present
6 changes: 6 additions & 0 deletions molecule/all_cluster/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
collections:
- name: community.general
- name: ansible.posix
- name: community.docker
version: ">=1.9.1"
1 change: 1 addition & 0 deletions molecule/all_cluster/roles
14 changes: 14 additions & 0 deletions molecule/all_cluster/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
- name: Verify
hosts: all
tasks:
- name: Populate service facts
ansible.builtin.service_facts:

- name: Check if amq_streams service started
assert:
that:
- ansible_facts.services["amq_streams_broker.service"]["state"] == "running"
- ansible_facts.services["amq_streams_broker.service"]["status"] == "enabled"
- ansible_facts.services["amq_streams_zookeeper.service"]["state"] == "running"
- ansible_facts.services["amq_streams_zookeeper.service"]["status"] == "enabled"

0 comments on commit d6b7aa1

Please sign in to comment.