Matrix Docker Ansible eploy
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 

34 lignes
1.5 KiB

  1. # SPDX-FileCopyrightText: 2026 Slavi Pantaleev
  2. #
  3. # SPDX-License-Identifier: AGPL-3.0-or-later
  4. ---
  5. - name: Find the declaration for the Meowlnir bot - {{ live_bot.username | quote }}
  6. ansible.builtin.set_fact:
  7. matrix_bot_meowlnir_declared_bot: >-
  8. {{
  9. (matrix_bot_meowlnir_bots | selectattr('username', 'equalto', live_bot.username) | list | first)
  10. | default({}, true)
  11. }}
  12. # Rooms created by the playbook are not declared anywhere, so bots which auto-create their management room are left alone.
  13. # Bots which are no longer declared at all fall through to the empty declaration, meaning all of their rooms get removed — which is also what has to happen before the bot itself can be deleted.
  14. - name: Determine which management rooms to remove - {{ live_bot.username | quote }}
  15. ansible.builtin.set_fact:
  16. matrix_bot_meowlnir_rooms_to_remove: >-
  17. {{
  18. []
  19. if (matrix_bot_meowlnir_declared_bot.management_room_auto_create | default(false) | bool)
  20. else (
  21. (live_bot.management_rooms | map(attribute='room_id') | list)
  22. | difference(matrix_bot_meowlnir_declared_bot.management_rooms | default([], true) | map(attribute='id') | list)
  23. )
  24. }}
  25. - name: Remove Meowlnir management rooms which are no longer declared - {{ live_bot.username | quote }}
  26. ansible.builtin.include_tasks: "{{ role_path }}/tasks/util/prune_management_room.yml"
  27. with_items: "{{ matrix_bot_meowlnir_rooms_to_remove }}"
  28. loop_control:
  29. loop_var: room_id_to_remove