parent
69a7847097
commit
0f7b89523f
@ -0,0 +1,35 @@
|
||||
---
|
||||
|
||||
- name: Fail if matrix-nginx-proxy role already executed
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
Trying to append mautrix-signalgo-metrics's reverse-proxying configuration to matrix-nginx-proxy,
|
||||
but it's pointless since the matrix-nginx-proxy role had already executed.
|
||||
To fix this, please change the order of roles in your playbook,
|
||||
so that the matrix-nginx-proxy role would run after the matrix-bridge-mautrix-signalgo role.
|
||||
when: matrix_nginx_proxy_role_executed | default(False) | bool
|
||||
|
||||
- when: matrix_mautrix_signalgo_metrics_proxying_enabled | bool
|
||||
block:
|
||||
- name: Generate mautrix-signalgo metrics proxying configuration for matrix-nginx-proxy (matrix.DOMAIN/metrics/mautrix-signalgo)
|
||||
ansible.builtin.set_fact:
|
||||
matrix_mautrix_signalgo_nginx_metrics_configuration_block: |
|
||||
location /metrics/mautrix-signalgo {
|
||||
{% if matrix_nginx_proxy_enabled | default(False) %}
|
||||
{# Use the embedded DNS resolver in Docker containers to discover the service #}
|
||||
resolver 127.0.0.11 valid=5s;
|
||||
set $backend "matrix-mautrix-signalgo:8001";
|
||||
proxy_pass http://$backend/metrics;
|
||||
{% else %}
|
||||
return 404 "matrix-nginx-proxy is disabled and no host port was bound to the container, so metrics are unavailable";
|
||||
{% endif %}
|
||||
}
|
||||
|
||||
- name: Register mautrix-signalgo metrics proxying configuration with matrix-nginx-proxy (matrix.DOMAIN/metrics/mautrix-signalgo)
|
||||
ansible.builtin.set_fact:
|
||||
matrix_nginx_proxy_proxy_matrix_metrics_additional_system_location_configuration_blocks: |
|
||||
{{
|
||||
matrix_nginx_proxy_proxy_matrix_metrics_additional_system_location_configuration_blocks | default([])
|
||||
+
|
||||
[matrix_mautrix_signalgo_nginx_metrics_configuration_block]
|
||||
}}
|
@ -1,11 +1,20 @@
|
||||
---
|
||||
|
||||
- name: Fail if required mautrix-signalgo settings not defined
|
||||
- name: Fail if required mautrix-whatsapp settings not defined
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item.name }}`).
|
||||
when: "item.when | bool and vars[item.name] == ''"
|
||||
with_items:
|
||||
- {'name': 'matrix_mautrix_signalgo_appservice_token', when: true}
|
||||
- {'name': 'matrix_mautrix_signalgo_homeserver_token', when: true}
|
||||
- {'name': 'matrix_mautrix_signalgo_database_hostname', when: "{{ matrix_mautrix_signalgo_database_engine == 'postgres' }}"}
|
||||
- {'name': 'matrix_mautrix_whatsapp_appservice_token', when: true}
|
||||
- {'name': 'matrix_mautrix_whatsapp_homeserver_token', when: true}
|
||||
- {'name': 'matrix_mautrix_whatsapp_database_hostname', when: "{{ matrix_mautrix_whatsapp_database_engine == 'postgres' }}"}
|
||||
|
||||
- name: (Deprecation) Catch and report renamed 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_mautrix_whatsapp_log_level', 'new': 'matrix_mautrix_whatsapp_logging_level'}
|
||||
|
Loading…
Reference in new issue