mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2025-03-04 21:16:17 +00:00

This: - brings consistency - no more mixing `_name_prefix` and `_registry_prefix` - adds extensibility - a future patch will allow reconfiguring all registry prefixes for all roles in the playbook We still have `_docker_` vs `_container_` inconsistencies. These may be worked on later.
47 lines
2.7 KiB
YAML
47 lines
2.7 KiB
YAML
---
|
|
|
|
- name: Fail if required matrix-bot-draupnir variables are undefined
|
|
ansible.builtin.fail:
|
|
msg: "The `{{ item.name }}` variable must be defined and have a non-null value."
|
|
with_items:
|
|
- {'name': 'matrix_bot_draupnir_access_token', when: "{{ not matrix_bot_draupnir_pantalaimon_use }}"}
|
|
- {'name': 'matrix_bot_draupnir_access_token', when: "{{ matrix_bot_draupnir_enable_experimental_rust_crypto }}"}
|
|
- {'name': 'matrix_bot_draupnir_management_room', when: true}
|
|
- {'name': 'matrix_bot_draupnir_container_network', when: true}
|
|
- {'name': 'matrix_bot_draupnir_homeserver_url', when: true}
|
|
- {'name': 'matrix_bot_draupnir_raw_homeserver_url', when: true}
|
|
- {'name': 'matrix_bot_draupnir_pantalaimon_username', when: "{{ matrix_bot_draupnir_pantalaimon_use }}"}
|
|
- {'name': 'matrix_bot_draupnir_pantalaimon_password', when: "{{ matrix_bot_draupnir_pantalaimon_use }}"}
|
|
when: "item.when | bool and (vars[item.name] == '' or vars[item.name] is none)"
|
|
|
|
- name: Fail if inappropriate variables are defined
|
|
ansible.builtin.fail:
|
|
msg: "The `{{ item.name }}` variable must be undefined or have a null value."
|
|
with_items:
|
|
- {'name': 'matrix_bot_draupnir_access_token', when: "{{ matrix_bot_draupnir_pantalaimon_use }}"}
|
|
- {'name': 'matrix_bot_draupnir_access_token', when: "{{ matrix_bot_draupnir_login_native }}"}
|
|
- {'name': 'matrix_bot_draupnir_pantalaimon_use', when: "{{ matrix_bot_draupnir_enable_experimental_rust_crypto }}"}
|
|
when: "item.when | bool and not (vars[item.name] == '' or vars[item.name] is none)"
|
|
|
|
- when: "matrix_bot_draupnir_pantalaimon_use == 'true' and matrix_bot_draupnir_pantalaimon_breakage_ignore == 'false'"
|
|
block:
|
|
- name: Inject warning if Pantalaimon is used together with Draupnir
|
|
ansible.builtin.set_fact:
|
|
devture_playbook_runtime_messages_list: |
|
|
{{
|
|
devture_playbook_runtime_messages_list | default([])
|
|
+
|
|
[
|
|
"Note: Draupnir does not support running with Pantalaimon as it would break all workflows that involve answering prompts with reactions. To enable E2EE for Draupnir, it is recommended to use matrix_bot_draupnir_enable_experimental_rust_crypto instead. This warning can be disabled by setting matrix_bot_draupnir_pantalaimon_breakage_ignore to true."
|
|
]
|
|
}}
|
|
|
|
- name: (Deprecation) Catch and report renamed Draupnir settings
|
|
ansible.builtin.fail:
|
|
msg: >-
|
|
Your configuration contains a variable, which now has a different name.
|
|
Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`).
|
|
when: "item.old in vars"
|
|
with_items:
|
|
- {'old': 'matrix_bot_draupnir_container_image_name_prefix', 'new': 'matrix_bot_draupnir_container_image_registry_prefix'}
|