This page describes the conventions used when developing this playbook and writing its documentation. Follow it when adding a new component (a role and its documentation page) or editing existing ones, so that everything stays consistent.
The guide is meant for anyone preparing a contribution, humans and AI agents alike. If you find existing files that deviate from it, feel free to send a pull request bringing them in line.
baibot, rageshake, coturn, mautrix-telegram) and keep their lowercase name even at the start of a sentence. When in doubt, follow the upstream project’s own spelling.1., 2., 3.), instead of relying on the Markdown renderer to fix a repeated (1., 1., 1.) or wrong (1., 2., 4.) sequence.- for unordered lists.`).```yaml, ```sh) for configuration and command examples.[Configuring DNS](configuring-dns.md)).Use these placeholder values in documentation and code comments, so examples look the same everywhere:
| What | Value |
|---|---|
| base domain | example.com |
| Matrix server domain | matrix.example.com |
| another (federated) server | example.org |
| user IDs | @alice:example.com, @bob:example.com |
| room ID | !qporfwt:example.com |
| room alias | #room:example.com |
The user and room ID values follow the examples in the Matrix specification. Never use real domains, usernames, or tokens in examples.
Component-specific identifiers (e.g. a bridge bot like @telegrambot:example.com) are fine where they make an example clearer.
Each component gets its own documentation page: docs/configuring-playbook-<component>.md (bridges use a configuring-playbook-bridge-<name>.md file name, bots use configuring-playbook-bot-<name>.md).
A typical page looks like this, with sections appearing in this order (sections that do not apply can be omitted):
# Setting up ComponentName (optional)
The playbook can install and configure [ComponentName](https://github.com/example/component) for you.
See the project's [documentation](https://github.com/example/component/blob/main/README.md) to learn what it does and why it might be useful to you.
## Prerequisites (optional)
## Adjusting DNS records
## Adjusting the playbook configuration
### Extending the configuration
## Installing
## Usage
## Troubleshooting
Notes:
inventory/host_vars/matrix.example.com/vars.yml file and shows a minimal yaml example.just command or ansible-playbook invocation to run.First, consider where the component belongs:
roles/custom/.requirements.yml.Besides the role itself and its documentation page, a new component touches a few other places. Make sure a pull request adding one covers all of them:
roles/custom/matrix-<component>/ (or an external role wired via requirements.yml, as described above).setup.yml.group_vars/matrix_servers. Wire the component to the rest of the playbook there (referencing variables of other roles), but keep values that the role can construct by itself in the role’s own defaults/main.yml.docs/configuring-playbook-<component>.md, linked from the table of contents in docs/README.md.README.md.docs/container-images.md, if the component runs a container.CHANGELOG.md entry announcing the new component.SPDX-FileCopyrightText and SPDX-License-Identifier comments, as this project follows the REUSE specification.Variable naming conventions:
matrix-bridge-mautrix-telegram role uses matrix_bridge_mautrix_telegram_* variables, the matrix-bot-mjolnir role uses matrix_bot_mjolnir_* variables, and so on._auto + _custom split: the main variable combines an _auto component (managed by the playbook via group_vars) and a _custom component (reserved for users). Where it makes sense, there is also a _default component, containing sensible defaults provided by the role itself. See matrix_bridge_hookshot_container_additional_networks and matrix_bridge_hookshot_systemd_required_services_list for examples.validate_config.yml tasks. The matrix_playbook_migration role handles the cases a role cannot: variables of completely eliminated roles (which no longer have their own validate_config.yml), and validation that needs to run very early for some reason.matrix_playbook_migration_expected_version and add a matching entry to the matrix_playbook_migration_breaking_changes list (a summary and a CHANGELOG.md link), in roles/custom/matrix_playbook_migration/defaults/main.yml. Users declare matrix_playbook_migration_validated_version in their configuration, and the playbook walks them through all breaking changes between their validated version and the expected one. Also update the recommended value in examples/vars.yml; a pre-commit check enforces that it matches the expected version.