Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

43 rivejä
2.7 KiB

  1. # SPDX-FileCopyrightText: 2024 Slavi Pantaleev
  2. # SPDX-FileCopyrightText: 2025 Suguru Hirahara
  3. #
  4. # SPDX-License-Identifier: AGPL-3.0-or-later
  5. ---
  6. - name: Fail if required baibot settings not defined
  7. ansible.builtin.fail:
  8. msg: >-
  9. You need to define a required configuration setting (`{{ item.name }}`).
  10. when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0"
  11. with_items:
  12. - {'name': 'matrix_bot_baibot_config_user_mxid_localpart', when: true}
  13. - {'name': 'matrix_bot_baibot_config_user_password', when: true}
  14. - {'name': 'matrix_bot_baibot_container_network', when: true}
  15. - {'name': 'matrix_bot_baibot_config_homeserver_url', when: true}
  16. - {'name': 'matrix_bot_baibot_config_agents_static_definitions_anthropic_config_api_key', when: "{{ matrix_bot_baibot_config_agents_static_definitions_anthropic_enabled }}"}
  17. - {'name': 'matrix_bot_baibot_config_agents_static_definitions_groq_config_api_key', when: "{{ matrix_bot_baibot_config_agents_static_definitions_groq_enabled }}"}
  18. - {'name': 'matrix_bot_baibot_config_agents_static_definitions_groq_config_text_generation_model_id', when: "{{ matrix_bot_baibot_config_agents_static_definitions_groq_enabled and matrix_bot_baibot_config_agents_static_definitions_groq_config_text_generation_enabled }}"}
  19. - {'name': 'matrix_bot_baibot_config_agents_static_definitions_mistral_config_api_key', when: "{{ matrix_bot_baibot_config_agents_static_definitions_mistral_enabled }}"}
  20. - {'name': 'matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_model_id', when: "{{ matrix_bot_baibot_config_agents_static_definitions_mistral_enabled and matrix_bot_baibot_config_agents_static_definitions_mistral_config_text_generation_enabled }}"}
  21. - {'name': 'matrix_bot_baibot_config_agents_static_definitions_openai_config_api_key', when: "{{ matrix_bot_baibot_config_agents_static_definitions_openai_enabled }}"}
  22. - name: Fail if admin patterns list is empty
  23. ansible.builtin.fail:
  24. msg: >-
  25. You need to define a required configuration setting (`matrix_bot_baibot_config_access_admin_patterns`) to specify which users are bot administrators.
  26. when: "matrix_bot_baibot_config_access_admin_patterns | length == 0"
  27. - name: (Deprecation) Catch and report renamed baibot settings
  28. ansible.builtin.fail:
  29. msg: >-
  30. Your configuration contains a variable, which now has a different name.
  31. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml).
  32. when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0"
  33. with_items:
  34. - {'old': 'matrix_bot_baibot_container_image_name_prefix', 'new': 'matrix_bot_baibot_container_image_registry_prefix'}