Matrix Docker Ansible eploy
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 

30 行
1.3 KiB

  1. # SPDX-FileCopyrightText: 2026 Slavi Pantaleev
  2. #
  3. # SPDX-License-Identifier: AGPL-3.0-or-later
  4. ---
  5. # Meowlnir's own database is the source of truth for which bots and management rooms exist, and it can be queried, so the playbook keeps no state of its own about them.
  6. - name: Ask Meowlnir which bots currently exist
  7. ansible.builtin.command:
  8. cmd: "{{ matrix_bot_meowlnir_bin_path }}/meowlnir-api GET /_meowlnir/v1/bots"
  9. register: matrix_bot_meowlnir_state_result
  10. changed_when: false
  11. failed_when: false
  12. - name: Fail if Meowlnir could not be asked which bots exist
  13. ansible.builtin.fail:
  14. msg: >-
  15. Could not read the list of bots from Meowlnir.
  16. Meowlnir said: {{ matrix_bot_meowlnir_state_result.stdout | default('') | trim }}
  17. {{ matrix_bot_meowlnir_state_result.stderr | default('') | trim }}
  18. when: >-
  19. matrix_bot_meowlnir_state_result.rc != 0
  20. or (matrix_bot_meowlnir_state_result.stdout_lines | default([]) | length == 0)
  21. or (matrix_bot_meowlnir_state_result.stdout_lines | last != '200')
  22. - name: Determine which bots and management rooms Meowlnir knows about
  23. ansible.builtin.set_fact:
  24. matrix_bot_meowlnir_live_bots: "{{ (matrix_bot_meowlnir_state_result.stdout_lines[:-1] | join('\n') | from_json).bots | default([], true) }}"