mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2026-05-13 23:39:19 +03:00
c82415cd7b
Replaces `community.docker.docker_image` with the modern `docker_image_pull` and `docker_image_build` split modules. Drops the `ansible_version` compatibility ladder and the now-redundant `_container_image_force_pull` variable (the new pull module handles registry refresh natively via `pull: always`). Also registers `_container_image_build_result` so that a self-build rebuild correctly triggers a service restart. Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/5191. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
95 lines
4.8 KiB
YAML
95 lines
4.8 KiB
YAML
# SPDX-FileCopyrightText: 2024 Slavi Pantaleev
|
|
# SPDX-FileCopyrightText: 2025 Suguru Hirahara
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
---
|
|
|
|
- name: Fail if required baibot settings not defined
|
|
ansible.builtin.fail:
|
|
msg: >-
|
|
You need to define a required configuration setting (`{{ item.name }}`).
|
|
when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0"
|
|
with_items:
|
|
- {'name': 'matrix_bot_baibot_config_user_mxid_localpart', when: true}
|
|
- {'name': 'matrix_bot_baibot_container_network', when: true}
|
|
- {'name': 'matrix_bot_baibot_config_homeserver_url', when: true}
|
|
|
|
- {'name': 'matrix_bot_baibot_config_agents_static_definitions_anthropic_config_api_key', when: "{{ matrix_bot_baibot_config_agents_static_definitions_anthropic_enabled }}"}
|
|
|
|
- {'name': 'matrix_bot_baibot_config_agents_static_definitions_groq_config_api_key', when: "{{ matrix_bot_baibot_config_agents_static_definitions_groq_enabled }}"}
|
|
- {'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 }}"}
|
|
|
|
- {'name': 'matrix_bot_baibot_config_agents_static_definitions_mistral_config_api_key', when: "{{ matrix_bot_baibot_config_agents_static_definitions_mistral_enabled }}"}
|
|
- {'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 }}"}
|
|
|
|
- {'name': 'matrix_bot_baibot_config_agents_static_definitions_openai_config_api_key', when: "{{ matrix_bot_baibot_config_agents_static_definitions_openai_enabled }}"}
|
|
|
|
- name: Fail if baibot authentication mode is not configured
|
|
ansible.builtin.fail:
|
|
msg: >-
|
|
You need to configure one baibot authentication mode:
|
|
either `matrix_bot_baibot_config_user_password`
|
|
or (`matrix_bot_baibot_config_user_access_token` + `matrix_bot_baibot_config_user_device_id`).
|
|
when: >-
|
|
(
|
|
matrix_bot_baibot_config_user_password | default('', true) | string | length == 0
|
|
)
|
|
and
|
|
(
|
|
matrix_bot_baibot_config_user_access_token | default('', true) | string | length == 0
|
|
and matrix_bot_baibot_config_user_device_id | default('', true) | string | length == 0
|
|
)
|
|
|
|
- name: Fail if baibot authentication mode is configured ambiguously
|
|
ansible.builtin.fail:
|
|
msg: >-
|
|
You need to configure exactly one baibot authentication mode.
|
|
Set either `matrix_bot_baibot_config_user_password`,
|
|
or (`matrix_bot_baibot_config_user_access_token` + `matrix_bot_baibot_config_user_device_id`) but not both.
|
|
when: >-
|
|
(
|
|
matrix_bot_baibot_config_user_password | default('', true) | string | length > 0
|
|
)
|
|
and
|
|
(
|
|
matrix_bot_baibot_config_user_access_token | default('', true) | string | length > 0
|
|
or matrix_bot_baibot_config_user_device_id | default('', true) | string | length > 0
|
|
)
|
|
|
|
- name: Fail if baibot access token authentication is incomplete
|
|
ansible.builtin.fail:
|
|
msg: >-
|
|
Access-token authentication requires both
|
|
`matrix_bot_baibot_config_user_access_token` and `matrix_bot_baibot_config_user_device_id`.
|
|
when: >-
|
|
(
|
|
matrix_bot_baibot_config_user_password | default('', true) | string | length == 0
|
|
)
|
|
and
|
|
(
|
|
matrix_bot_baibot_config_user_access_token | default('', true) | string | length > 0
|
|
or matrix_bot_baibot_config_user_device_id | default('', true) | string | length > 0
|
|
)
|
|
and
|
|
(
|
|
matrix_bot_baibot_config_user_access_token | default('', true) | string | length == 0
|
|
or matrix_bot_baibot_config_user_device_id | default('', true) | string | length == 0
|
|
)
|
|
|
|
- name: Fail if admin patterns list is empty
|
|
ansible.builtin.fail:
|
|
msg: >-
|
|
You need to define a required configuration setting (`matrix_bot_baibot_config_access_admin_patterns`) to specify which users are bot administrators.
|
|
when: "matrix_bot_baibot_config_access_admin_patterns | length == 0"
|
|
|
|
- name: (Deprecation) Catch and report renamed baibot settings
|
|
ansible.builtin.fail:
|
|
msg: >-
|
|
Your configuration contains a variable, which now has a different name.
|
|
Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml).
|
|
when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0"
|
|
with_items:
|
|
- {'old': 'matrix_bot_baibot_container_image_name_prefix', 'new': 'matrix_bot_baibot_container_image_registry_prefix'}
|
|
- {'old': 'matrix_bot_baibot_container_image_force_pull', 'new': '<removed> (the new community.docker.docker_image_pull module handles this natively)'}
|