Matrix Docker Ansible eploy
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 

42 rader
1.9 KiB

  1. # SPDX-FileCopyrightText: 2026 Slavi Pantaleev
  2. #
  3. # SPDX-License-Identifier: AGPL-3.0-or-later
  4. ---
  5. # Only reached for bots which are no longer declared, and only after their management rooms have been de-registered — Meowlnir refuses to delete a bot which is still in use.
  6. - name: Remove Meowlnir bot - {{ live_bot.username | quote }}
  7. ansible.builtin.command:
  8. cmd: >-
  9. {{ matrix_bot_meowlnir_bin_path }}/meowlnir-api
  10. DELETE /_meowlnir/v1/bot/{{ live_bot.username }}
  11. register: matrix_bot_meowlnir_bot_removal_result
  12. changed_when: "matrix_bot_meowlnir_bot_removal_result.stdout_lines | default([]) | last | default('') == '200'"
  13. failed_when: false
  14. - name: Fail if the Meowlnir bot could not be removed - {{ live_bot.username | quote }}
  15. ansible.builtin.fail:
  16. msg: >-
  17. Removing the Meowlnir bot `{{ live_bot.username }}` failed.
  18. Meowlnir said: {{ matrix_bot_meowlnir_bot_removal_result.stdout | default('') | trim }}
  19. {{ matrix_bot_meowlnir_bot_removal_result.stderr | default('') | trim }}
  20. when: >-
  21. matrix_bot_meowlnir_bot_removal_result.rc != 0
  22. or (matrix_bot_meowlnir_bot_removal_result.stdout_lines | default([]) | length == 0)
  23. or (matrix_bot_meowlnir_bot_removal_result.stdout_lines | last not in ['200', '404'])
  24. - name: Report the removed Meowlnir bot - {{ live_bot.username | quote }}
  25. ansible.builtin.set_fact:
  26. devture_playbook_runtime_messages_list: >-
  27. {{
  28. devture_playbook_runtime_messages_list | default([])
  29. +
  30. [
  31. "Note: the Meowlnir bot " ~ live_bot.username ~ " is no longer declared in matrix_bot_meowlnir_bots," ~
  32. " so Meowlnir has been told to forget it. Its Matrix user is not deactivated and remains in the rooms" ~
  33. " it had joined - clean that up separately if you want it gone for good."
  34. ]
  35. }}
  36. when: "matrix_bot_meowlnir_bot_removal_result.stdout_lines | default([]) | last | default('') == '200'"