# SPDX-FileCopyrightText: 2026 Slavi Pantaleev # # SPDX-License-Identifier: AGPL-3.0-or-later --- # Validation lives in validate_config.yml so that it also runs on regular setup/install runs, catching mistakes long before anyone reaches for the `ensure-matrix-users-created` tag. # It is repeated here because this tag can be run on its own, and creating a bot outside the appservice's user namespace fails in ways that are hard to trace back. - name: Validate matrix-bot-meowlnir configuration before creating bots ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml" - name: Ensure matrix-bot-meowlnir is started before creating bots ansible.builtin.service: name: matrix-bot-meowlnir.service state: started daemon_reload: true register: matrix_bot_meowlnir_start_result - name: Wait a while, so that Meowlnir can manage to start before creating bots ansible.builtin.pause: seconds: "{{ matrix_bot_meowlnir_bots_start_wait_time_seconds }}" when: matrix_bot_meowlnir_start_result.changed | bool - name: Read which bots Meowlnir already has ansible.builtin.include_tasks: "{{ role_path }}/tasks/util/read_meowlnir_state.yml" - name: Ensure Meowlnir bots created ansible.builtin.include_tasks: "{{ role_path }}/tasks/util/ensure_bot_created.yml" with_items: "{{ matrix_bot_meowlnir_bots }}" loop_control: loop_var: bot - name: Remove Meowlnir bots which are no longer declared ansible.builtin.include_tasks: "{{ role_path }}/tasks/util/prune_bots.yml" when: matrix_bot_meowlnir_bots_pruning_enabled | bool