mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2026-08-30 20:43:13 +00:00
Not for merging as-is. One role's scenario plus the workflow that would make per-role testing affordable here, so we can see how it behaves before deciding whether to do the other 69. Unlike the MASH repositories, one repository holds every role, so running everything on every push is not an option. The workflow's first job works out which roles a push touched and builds the matrix from that; a change to docs, or to a role with no scenario yet, runs nothing. Three things this role needed that a MASH role does not: - The variables matrix-base would supply (matrix_base_data_path, matrix_domain, matrix_user_name, matrix_group_name and the uid/gid) have to be provided by the scenario, and the user and group have to exist before the role's file tasks run. - The service contacts the homeserver while starting up - it fetches /_matrix/client/v3/joined_rooms to resolve its room mapping and exits 1 if that fails - so prepare.yml stands up a stub homeserver. Most roles here are bridges and bots, so this is likely the rule rather than the exception. - verify.yml runs as its own play, where role defaults are out of scope, so the paths it reads are pinned in molecule.yml. The version is deliberately NOT pinned: it is read from defaults/main.yml so the assertion compares the running image against what the role ships. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
42 lines
1.5 KiB
YAML
42 lines
1.5 KiB
YAML
# SPDX-FileCopyrightText: 2026 Slavi Pantaleev
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
---
|
|
# The devture base roles carry the variables this role reads
|
|
# (`devture_systemd_docker_base_*`, `devture_playbook_help_*`), the same way
|
|
# they do when the playbook runs. `matrix-base` is deliberately NOT included:
|
|
# it does far more than this role needs, and the two variables it would supply
|
|
# are set directly in molecule.yml instead.
|
|
- name: Include roles for matrix-alertmanager-receiver Molecule tests
|
|
hosts: all
|
|
become: true
|
|
gather_facts: true
|
|
tasks:
|
|
- name: Include roles for matrix-alertmanager-receiver Molecule tests
|
|
ansible.builtin.include_role:
|
|
name: "{{ role_name }}"
|
|
public: true
|
|
loop:
|
|
- com.devture.ansible.role.playbook_help
|
|
- com.devture.ansible.role.systemd_docker_base
|
|
- "custom/{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
|
|
loop_control:
|
|
loop_var: role_name
|
|
|
|
# The role installs the unit but does not start it - in the playbook that is
|
|
# `systemd_service_manager`'s job - so the scenario starts it here.
|
|
- name: Ensure matrix-alertmanager-receiver is started
|
|
hosts: all
|
|
become: true
|
|
gather_facts: false
|
|
tasks:
|
|
- name: Ensure systemd daemon is reloaded
|
|
ansible.builtin.systemd_service:
|
|
daemon_reload: true
|
|
|
|
- name: Ensure matrix-alertmanager-receiver systemd service is started
|
|
ansible.builtin.systemd_service:
|
|
name: matrix-alertmanager-receiver.service
|
|
state: started
|