mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2026-07-16 19:53:53 +03:00
Rename matrix_meshtastic_relay_* variables to matrix_bridge_meshtastic_relay_*
Part of adopting a uniform naming policy for bridge variables, where the variable prefix matches the role directory name. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -26,42 +26,42 @@ You also need access to a Meshtastic device, connected to the server via one of:
|
||||
To enable the bridge, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
|
||||
|
||||
```yaml
|
||||
matrix_meshtastic_relay_enabled: true
|
||||
matrix_bridge_meshtastic_relay_enabled: true
|
||||
|
||||
# Password for the bot's Matrix account.
|
||||
# On first startup, the bridge uses this to log in and persist credentials
|
||||
# (including End-to-End Encryption material) under its data directory.
|
||||
# After that, the password can be removed from this variable.
|
||||
matrix_meshtastic_relay_matrix_bot_password: "PASSWORD_FOR_THE_BOT"
|
||||
matrix_bridge_meshtastic_relay_matrix_bot_password: "PASSWORD_FOR_THE_BOT"
|
||||
|
||||
# How the bridge connects to your Meshtastic device.
|
||||
# One of: tcp, serial, ble
|
||||
matrix_meshtastic_relay_connection_type: tcp
|
||||
matrix_bridge_meshtastic_relay_connection_type: tcp
|
||||
|
||||
# For connection_type: tcp
|
||||
matrix_meshtastic_relay_tcp_host: "meshtastic.local"
|
||||
matrix_bridge_meshtastic_relay_tcp_host: "meshtastic.local"
|
||||
|
||||
# For connection_type: serial
|
||||
# matrix_meshtastic_relay_serial_port: "/dev/ttyUSB0"
|
||||
# matrix_bridge_meshtastic_relay_serial_port: "/dev/ttyUSB0"
|
||||
|
||||
# For connection_type: ble
|
||||
# matrix_meshtastic_relay_ble_address: "AA:BB:CC:DD:EE:FF"
|
||||
# matrix_bridge_meshtastic_relay_ble_address: "AA:BB:CC:DD:EE:FF"
|
||||
|
||||
# Matrix rooms to bridge to Meshtastic channels.
|
||||
matrix_meshtastic_relay_matrix_rooms_list:
|
||||
matrix_bridge_meshtastic_relay_matrix_rooms_list:
|
||||
- id: "#meshtastic:{{ matrix_domain }}"
|
||||
meshtastic_channel: "0"
|
||||
```
|
||||
|
||||
By default, the bot's Matrix ID is `@meshtasticbot:{{ matrix_domain }}`. To change it, adjust `matrix_meshtastic_relay_matrix_bot_user_id`.
|
||||
By default, the bot's Matrix ID is `@meshtasticbot:{{ matrix_domain }}`. To change it, adjust `matrix_bridge_meshtastic_relay_matrix_bot_user_id`.
|
||||
|
||||
### Bluetooth (BLE) connections
|
||||
|
||||
When `matrix_meshtastic_relay_connection_type` is `ble`, the container runs with `--network=host` and bind-mounts the host's DBus socket — both are required for Bluetooth pairing/communication. Only use this connection type if you trust the playbook-managed host and are comfortable with these privileges.
|
||||
When `matrix_bridge_meshtastic_relay_connection_type` is `ble`, the container runs with `--network=host` and bind-mounts the host's DBus socket — both are required for Bluetooth pairing/communication. Only use this connection type if you trust the playbook-managed host and are comfortable with these privileges.
|
||||
|
||||
### Serial connections
|
||||
|
||||
When `matrix_meshtastic_relay_connection_type` is `serial`, the host device referenced by `matrix_meshtastic_relay_serial_port` is passed through to the container. Make sure that `matrix_user_uid` / `matrix_user_gid` have read/write access to that device (e.g. by adding the matrix user to the `dialout` group, or adjusting udev rules).
|
||||
When `matrix_bridge_meshtastic_relay_connection_type` is `serial`, the host device referenced by `matrix_bridge_meshtastic_relay_serial_port` is passed through to the container. Make sure that `matrix_user_uid` / `matrix_user_gid` have read/write access to that device (e.g. by adding the matrix user to the `dialout` group, or adjusting udev rules).
|
||||
|
||||
### Extending the configuration
|
||||
|
||||
@@ -69,7 +69,7 @@ There are some additional things you may wish to configure about the bridge.
|
||||
|
||||
Take a look at:
|
||||
|
||||
- `roles/custom/matrix-bridge-meshtastic-relay/defaults/main.yml` for some variables that you can customize via your `vars.yml` file. You can override individual `matrix_meshtastic_relay_*` variables, or make finer-grained adjustments via `matrix_meshtastic_relay_configuration_extension_yaml`.
|
||||
- `roles/custom/matrix-bridge-meshtastic-relay/defaults/main.yml` for some variables that you can customize via your `vars.yml` file. You can override individual `matrix_bridge_meshtastic_relay_*` variables, or make finer-grained adjustments via `matrix_bridge_meshtastic_relay_configuration_extension_yaml`.
|
||||
|
||||
## Installing
|
||||
|
||||
@@ -86,7 +86,7 @@ The shortcut commands with the [`just` program](just.md) are also available: `ju
|
||||
|
||||
## Usage
|
||||
|
||||
Invite the bot to the Matrix rooms listed in `matrix_meshtastic_relay_matrix_rooms_list` and it will relay between Matrix and the corresponding Meshtastic channel. Messages sent on Meshtastic will appear in Matrix and vice versa.
|
||||
Invite the bot to the Matrix rooms listed in `matrix_bridge_meshtastic_relay_matrix_rooms_list` and it will relay between Matrix and the corresponding Meshtastic channel. Messages sent on Meshtastic will appear in Matrix and vice versa.
|
||||
|
||||
See the [project's wiki](https://github.com/jeremiah-k/meshtastic-matrix-relay/wiki) for details about commands, plugins and advanced usage.
|
||||
|
||||
|
||||
+10
-10
@@ -408,9 +408,9 @@ devture_systemd_service_manager_services_list_auto: |
|
||||
([{
|
||||
'name': 'matrix-meshtastic-relay.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': (matrix_meshtastic_relay_restart_necessary | bool),
|
||||
'restart_necessary': (matrix_bridge_meshtastic_relay_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'meshtastic-relay'],
|
||||
}] if matrix_meshtastic_relay_enabled else [])
|
||||
}] if matrix_bridge_meshtastic_relay_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-mautrix-bluesky.service',
|
||||
@@ -2639,24 +2639,24 @@ matrix_bridge_hookshot_public_scheme: "{{ 'https' if matrix_playbook_ssl_enabled
|
||||
######################################################################
|
||||
|
||||
# We don't enable bridges by default.
|
||||
matrix_meshtastic_relay_enabled: false
|
||||
matrix_bridge_meshtastic_relay_enabled: false
|
||||
|
||||
matrix_meshtastic_relay_container_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_meshtastic_relay_container_image_registry_prefix_upstream_default }}"
|
||||
matrix_bridge_meshtastic_relay_container_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_bridge_meshtastic_relay_container_image_registry_prefix_upstream_default }}"
|
||||
|
||||
matrix_meshtastic_relay_matrix_host: "{{ matrix_domain }}"
|
||||
matrix_bridge_meshtastic_relay_matrix_host: "{{ matrix_domain }}"
|
||||
|
||||
matrix_meshtastic_relay_matrix_homeserver_url: "{{ matrix_addons_homeserver_client_api_url }}"
|
||||
matrix_bridge_meshtastic_relay_matrix_homeserver_url: "{{ matrix_addons_homeserver_client_api_url }}"
|
||||
|
||||
matrix_meshtastic_relay_container_network: "{{ matrix_addons_container_network }}"
|
||||
matrix_bridge_meshtastic_relay_container_network: "{{ matrix_addons_container_network }}"
|
||||
|
||||
matrix_meshtastic_relay_systemd_required_services_list_auto: |
|
||||
matrix_bridge_meshtastic_relay_systemd_required_services_list_auto: |
|
||||
{{
|
||||
matrix_addons_homeserver_systemd_services_list
|
||||
}}
|
||||
|
||||
matrix_meshtastic_relay_container_additional_networks_auto: |
|
||||
matrix_bridge_meshtastic_relay_container_additional_networks_auto: |
|
||||
{{
|
||||
([] if matrix_addons_homeserver_container_network == '' or matrix_addons_homeserver_container_network == matrix_meshtastic_relay_container_network else [matrix_addons_homeserver_container_network])
|
||||
([] if matrix_addons_homeserver_container_network == '' or matrix_addons_homeserver_container_network == matrix_bridge_meshtastic_relay_container_network else [matrix_addons_homeserver_container_network])
|
||||
}}
|
||||
|
||||
######################################################################
|
||||
|
||||
@@ -7,115 +7,115 @@
|
||||
# matrix-meshtastic-relay is a Matrix <-> Meshtastic bridge.
|
||||
# Project source code URL: https://github.com/jeremiah-k/meshtastic-matrix-relay
|
||||
|
||||
matrix_meshtastic_relay_enabled: true
|
||||
matrix_bridge_meshtastic_relay_enabled: true
|
||||
|
||||
# renovate: datasource=docker depName=jeremiah-k/mmrelay packageName=ghcr.io/jeremiah-k/mmrelay
|
||||
matrix_meshtastic_relay_version: 1.3.8
|
||||
matrix_meshtastic_relay_container_image: "{{ matrix_meshtastic_relay_container_image_registry_prefix }}jeremiah-k/mmrelay:{{ matrix_meshtastic_relay_version }}"
|
||||
matrix_meshtastic_relay_container_image_registry_prefix: "{{ matrix_meshtastic_relay_container_image_registry_prefix_upstream }}"
|
||||
matrix_meshtastic_relay_container_image_registry_prefix_upstream: "{{ matrix_meshtastic_relay_container_image_registry_prefix_upstream_default }}"
|
||||
matrix_meshtastic_relay_container_image_registry_prefix_upstream_default: "ghcr.io/"
|
||||
matrix_bridge_meshtastic_relay_version: 1.3.8
|
||||
matrix_bridge_meshtastic_relay_container_image: "{{ matrix_bridge_meshtastic_relay_container_image_registry_prefix }}jeremiah-k/mmrelay:{{ matrix_bridge_meshtastic_relay_version }}"
|
||||
matrix_bridge_meshtastic_relay_container_image_registry_prefix: "{{ matrix_bridge_meshtastic_relay_container_image_registry_prefix_upstream }}"
|
||||
matrix_bridge_meshtastic_relay_container_image_registry_prefix_upstream: "{{ matrix_bridge_meshtastic_relay_container_image_registry_prefix_upstream_default }}"
|
||||
matrix_bridge_meshtastic_relay_container_image_registry_prefix_upstream_default: "ghcr.io/"
|
||||
|
||||
matrix_meshtastic_relay_base_path: "{{ matrix_base_data_path }}/meshtastic-relay"
|
||||
matrix_bridge_meshtastic_relay_base_path: "{{ matrix_base_data_path }}/meshtastic-relay"
|
||||
|
||||
# Holds the Ansible-managed `config.yaml`. Mounted read-only at `/config` in the
|
||||
# container; mmrelay is pointed at `/config/config.yaml` via the `--config` CLI flag.
|
||||
matrix_meshtastic_relay_config_path: "{{ matrix_meshtastic_relay_base_path }}/config"
|
||||
matrix_bridge_meshtastic_relay_config_path: "{{ matrix_bridge_meshtastic_relay_base_path }}/config"
|
||||
|
||||
# Runtime data directory. Mounted read-write at `/data` (MMRELAY_HOME) in the container.
|
||||
# mmrelay auto-creates `database/`, `logs/`, `matrix/` (credentials + E2EE store)
|
||||
# and `plugins/` subdirectories underneath as needed.
|
||||
matrix_meshtastic_relay_data_path: "{{ matrix_meshtastic_relay_base_path }}/data"
|
||||
matrix_bridge_meshtastic_relay_data_path: "{{ matrix_bridge_meshtastic_relay_base_path }}/data"
|
||||
|
||||
matrix_meshtastic_relay_container_network: ""
|
||||
matrix_bridge_meshtastic_relay_container_network: ""
|
||||
|
||||
matrix_meshtastic_relay_container_additional_networks: "{{ matrix_meshtastic_relay_container_additional_networks_auto + matrix_meshtastic_relay_container_additional_networks_custom }}"
|
||||
matrix_meshtastic_relay_container_additional_networks_auto: []
|
||||
matrix_meshtastic_relay_container_additional_networks_custom: []
|
||||
matrix_bridge_meshtastic_relay_container_additional_networks: "{{ matrix_bridge_meshtastic_relay_container_additional_networks_auto + matrix_bridge_meshtastic_relay_container_additional_networks_custom }}"
|
||||
matrix_bridge_meshtastic_relay_container_additional_networks_auto: []
|
||||
matrix_bridge_meshtastic_relay_container_additional_networks_custom: []
|
||||
|
||||
# A list of extra arguments to pass to the container
|
||||
matrix_meshtastic_relay_container_extra_arguments: []
|
||||
matrix_bridge_meshtastic_relay_container_extra_arguments: []
|
||||
|
||||
# List of systemd services that matrix-meshtastic-relay.service depends on.
|
||||
matrix_meshtastic_relay_systemd_required_services_list: "{{ matrix_meshtastic_relay_systemd_required_services_list_default + matrix_meshtastic_relay_systemd_required_services_list_auto + matrix_meshtastic_relay_systemd_required_services_list_custom }}"
|
||||
matrix_meshtastic_relay_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
|
||||
matrix_meshtastic_relay_systemd_required_services_list_auto: []
|
||||
matrix_meshtastic_relay_systemd_required_services_list_custom: []
|
||||
matrix_bridge_meshtastic_relay_systemd_required_services_list: "{{ matrix_bridge_meshtastic_relay_systemd_required_services_list_default + matrix_bridge_meshtastic_relay_systemd_required_services_list_auto + matrix_bridge_meshtastic_relay_systemd_required_services_list_custom }}"
|
||||
matrix_bridge_meshtastic_relay_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
|
||||
matrix_bridge_meshtastic_relay_systemd_required_services_list_auto: []
|
||||
matrix_bridge_meshtastic_relay_systemd_required_services_list_custom: []
|
||||
|
||||
# List of systemd services that matrix-meshtastic-relay.service wants
|
||||
matrix_meshtastic_relay_systemd_wanted_services_list: []
|
||||
matrix_bridge_meshtastic_relay_systemd_wanted_services_list: []
|
||||
|
||||
# Hostname of the Matrix homeserver the bot connects to.
|
||||
matrix_meshtastic_relay_matrix_host: ""
|
||||
matrix_bridge_meshtastic_relay_matrix_host: ""
|
||||
|
||||
# URL of the Matrix homeserver the bot connects to.
|
||||
matrix_meshtastic_relay_matrix_homeserver_url: "https://{{ matrix_meshtastic_relay_matrix_host }}"
|
||||
matrix_bridge_meshtastic_relay_matrix_homeserver_url: "https://{{ matrix_bridge_meshtastic_relay_matrix_host }}"
|
||||
|
||||
# Fully-qualified Matrix ID of the bot user.
|
||||
matrix_meshtastic_relay_matrix_bot_user_id: "@meshtasticbot:{{ matrix_meshtastic_relay_matrix_host }}"
|
||||
matrix_bridge_meshtastic_relay_matrix_bot_user_id: "@meshtasticbot:{{ matrix_bridge_meshtastic_relay_matrix_host }}"
|
||||
|
||||
# Password for the bot's Matrix account.
|
||||
# On first startup, mmrelay uses this to log in and persist credentials (including E2EE
|
||||
# material) under `{{ matrix_meshtastic_relay_data_path }}/matrix/` on the host. After
|
||||
# material) under `{{ matrix_bridge_meshtastic_relay_data_path }}/matrix/` on the host. After
|
||||
# that, the password can (and should) be cleared from configuration.
|
||||
matrix_meshtastic_relay_matrix_bot_password: ""
|
||||
matrix_bridge_meshtastic_relay_matrix_bot_password: ""
|
||||
|
||||
# Controls whether End-to-End Encryption is enabled.
|
||||
# Requires password-based login on first start so that mmrelay can create `credentials.json`.
|
||||
matrix_meshtastic_relay_e2ee_enabled: true
|
||||
matrix_bridge_meshtastic_relay_e2ee_enabled: true
|
||||
|
||||
# Connection type to the Meshtastic device. One of: "tcp", "serial", "ble".
|
||||
matrix_meshtastic_relay_connection_type: ""
|
||||
matrix_bridge_meshtastic_relay_connection_type: ""
|
||||
|
||||
# For `tcp` connection type: hostname/IP of the Meshtastic device to connect to.
|
||||
matrix_meshtastic_relay_tcp_host: "meshtastic.local"
|
||||
matrix_bridge_meshtastic_relay_tcp_host: "meshtastic.local"
|
||||
|
||||
# For `serial` connection type: path of the serial device to connect to.
|
||||
# This device is passed through to the container. The host must have it available.
|
||||
matrix_meshtastic_relay_serial_port: "/dev/ttyUSB0"
|
||||
matrix_bridge_meshtastic_relay_serial_port: "/dev/ttyUSB0"
|
||||
|
||||
# For `ble` connection type: BLE MAC address of the Meshtastic device to connect to.
|
||||
# BLE requires `--network=host` and a DBus bind-mount (see the systemd service template).
|
||||
matrix_meshtastic_relay_ble_address: "AA:BB:CC:DD:EE:FF"
|
||||
matrix_bridge_meshtastic_relay_ble_address: "AA:BB:CC:DD:EE:FF"
|
||||
|
||||
# Display name of the Meshtastic network.
|
||||
matrix_meshtastic_relay_meshnet_name: "MediumFast"
|
||||
matrix_bridge_meshtastic_relay_meshnet_name: "MediumFast"
|
||||
|
||||
# Whether relaying from Matrix to Meshtastic is enabled.
|
||||
matrix_meshtastic_relay_meshtastic_broadcast_enabled: true
|
||||
matrix_bridge_meshtastic_relay_meshtastic_broadcast_enabled: true
|
||||
|
||||
# Matrix rooms to bridge to Meshtastic channels.
|
||||
# Each entry should have an `id` (Matrix room alias or room ID) and a `meshtastic_channel`.
|
||||
matrix_meshtastic_relay_matrix_rooms_list:
|
||||
- id: "#meshtastic:{{ matrix_meshtastic_relay_matrix_host }}"
|
||||
matrix_bridge_meshtastic_relay_matrix_rooms_list:
|
||||
- id: "#meshtastic:{{ matrix_bridge_meshtastic_relay_matrix_host }}"
|
||||
meshtastic_channel: "0"
|
||||
|
||||
# Whether plugins should only respond when the bot is explicitly mentioned.
|
||||
matrix_meshtastic_relay_plugin_global_require_bot_mention: true
|
||||
matrix_bridge_meshtastic_relay_plugin_global_require_bot_mention: true
|
||||
|
||||
# Enabled built-in ("core") plugins.
|
||||
# See: https://github.com/jeremiah-k/meshtastic-matrix-relay/wiki/Core-Plugins
|
||||
matrix_meshtastic_relay_plugins_ping_enabled: true
|
||||
matrix_meshtastic_relay_plugins_health_enabled: true
|
||||
matrix_meshtastic_relay_plugins_weather_enabled: true
|
||||
matrix_meshtastic_relay_plugins_weather_units: metric
|
||||
matrix_meshtastic_relay_plugins_telemetry_enabled: true
|
||||
matrix_meshtastic_relay_plugins_map_enabled: true
|
||||
matrix_meshtastic_relay_plugins_nodes_enabled: true
|
||||
matrix_bridge_meshtastic_relay_plugins_ping_enabled: true
|
||||
matrix_bridge_meshtastic_relay_plugins_health_enabled: true
|
||||
matrix_bridge_meshtastic_relay_plugins_weather_enabled: true
|
||||
matrix_bridge_meshtastic_relay_plugins_weather_units: metric
|
||||
matrix_bridge_meshtastic_relay_plugins_telemetry_enabled: true
|
||||
matrix_bridge_meshtastic_relay_plugins_map_enabled: true
|
||||
matrix_bridge_meshtastic_relay_plugins_nodes_enabled: true
|
||||
|
||||
# Default configuration passed to the bridge via config.yaml.
|
||||
# See `../templates/config.yaml.j2` for what's rendered.
|
||||
# Use `matrix_meshtastic_relay_configuration_extension_yaml` to override
|
||||
# Use `matrix_bridge_meshtastic_relay_configuration_extension_yaml` to override
|
||||
# specific values or add/remove keys without having to maintain a full copy here.
|
||||
matrix_meshtastic_relay_configuration_default:
|
||||
matrix_bridge_meshtastic_relay_configuration_default:
|
||||
matrix:
|
||||
homeserver: "{{ matrix_meshtastic_relay_matrix_homeserver_url }}"
|
||||
password: "{{ matrix_meshtastic_relay_matrix_bot_password }}"
|
||||
bot_user_id: "{{ matrix_meshtastic_relay_matrix_bot_user_id }}"
|
||||
homeserver: "{{ matrix_bridge_meshtastic_relay_matrix_homeserver_url }}"
|
||||
password: "{{ matrix_bridge_meshtastic_relay_matrix_bot_password }}"
|
||||
bot_user_id: "{{ matrix_bridge_meshtastic_relay_matrix_bot_user_id }}"
|
||||
e2ee:
|
||||
enabled: "{{ matrix_meshtastic_relay_e2ee_enabled }}"
|
||||
matrix_rooms: "{{ matrix_meshtastic_relay_matrix_rooms_list }}"
|
||||
meshtastic: "{{ matrix_meshtastic_relay_meshtastic_configuration }}"
|
||||
enabled: "{{ matrix_bridge_meshtastic_relay_e2ee_enabled }}"
|
||||
matrix_rooms: "{{ matrix_bridge_meshtastic_relay_matrix_rooms_list }}"
|
||||
meshtastic: "{{ matrix_bridge_meshtastic_relay_meshtastic_configuration }}"
|
||||
logging:
|
||||
level: info
|
||||
log_to_file: false
|
||||
@@ -129,39 +129,39 @@ matrix_meshtastic_relay_configuration_default:
|
||||
msgs_to_keep: 500
|
||||
wipe_on_restart: true
|
||||
plugins:
|
||||
require_bot_mention: "{{ matrix_meshtastic_relay_plugin_global_require_bot_mention }}"
|
||||
require_bot_mention: "{{ matrix_bridge_meshtastic_relay_plugin_global_require_bot_mention }}"
|
||||
ping:
|
||||
active: "{{ matrix_meshtastic_relay_plugins_ping_enabled }}"
|
||||
active: "{{ matrix_bridge_meshtastic_relay_plugins_ping_enabled }}"
|
||||
health:
|
||||
active: "{{ matrix_meshtastic_relay_plugins_health_enabled }}"
|
||||
active: "{{ matrix_bridge_meshtastic_relay_plugins_health_enabled }}"
|
||||
weather:
|
||||
active: "{{ matrix_meshtastic_relay_plugins_weather_enabled }}"
|
||||
units: "{{ matrix_meshtastic_relay_plugins_weather_units }}"
|
||||
active: "{{ matrix_bridge_meshtastic_relay_plugins_weather_enabled }}"
|
||||
units: "{{ matrix_bridge_meshtastic_relay_plugins_weather_units }}"
|
||||
telemetry:
|
||||
active: "{{ matrix_meshtastic_relay_plugins_telemetry_enabled }}"
|
||||
active: "{{ matrix_bridge_meshtastic_relay_plugins_telemetry_enabled }}"
|
||||
map:
|
||||
active: "{{ matrix_meshtastic_relay_plugins_map_enabled }}"
|
||||
active: "{{ matrix_bridge_meshtastic_relay_plugins_map_enabled }}"
|
||||
nodes:
|
||||
active: "{{ matrix_meshtastic_relay_plugins_nodes_enabled }}"
|
||||
active: "{{ matrix_bridge_meshtastic_relay_plugins_nodes_enabled }}"
|
||||
|
||||
# Connection-type-specific `meshtastic` configuration block used by
|
||||
# `matrix_meshtastic_relay_configuration_default`.
|
||||
matrix_meshtastic_relay_meshtastic_configuration: |
|
||||
# `matrix_bridge_meshtastic_relay_configuration_default`.
|
||||
matrix_bridge_meshtastic_relay_meshtastic_configuration: |
|
||||
{{
|
||||
(
|
||||
{'connection_type': 'tcp', 'host': matrix_meshtastic_relay_tcp_host}
|
||||
if matrix_meshtastic_relay_connection_type == 'tcp' else
|
||||
{'connection_type': 'tcp', 'host': matrix_bridge_meshtastic_relay_tcp_host}
|
||||
if matrix_bridge_meshtastic_relay_connection_type == 'tcp' else
|
||||
(
|
||||
{'connection_type': 'serial', 'serial_port': matrix_meshtastic_relay_serial_port}
|
||||
if matrix_meshtastic_relay_connection_type == 'serial' else
|
||||
{'connection_type': 'serial', 'serial_port': matrix_bridge_meshtastic_relay_serial_port}
|
||||
if matrix_bridge_meshtastic_relay_connection_type == 'serial' else
|
||||
(
|
||||
{'connection_type': 'ble', 'ble_address': matrix_meshtastic_relay_ble_address}
|
||||
if matrix_meshtastic_relay_connection_type == 'ble' else {}
|
||||
{'connection_type': 'ble', 'ble_address': matrix_bridge_meshtastic_relay_ble_address}
|
||||
if matrix_bridge_meshtastic_relay_connection_type == 'ble' else {}
|
||||
)
|
||||
)
|
||||
) | combine({
|
||||
'meshnet_name': matrix_meshtastic_relay_meshnet_name,
|
||||
'broadcast_enabled': matrix_meshtastic_relay_meshtastic_broadcast_enabled,
|
||||
'meshnet_name': matrix_bridge_meshtastic_relay_meshnet_name,
|
||||
'broadcast_enabled': matrix_bridge_meshtastic_relay_meshtastic_broadcast_enabled,
|
||||
'message_interactions': {
|
||||
'reactions': false,
|
||||
'replies': false,
|
||||
@@ -170,27 +170,27 @@ matrix_meshtastic_relay_meshtastic_configuration: |
|
||||
}}
|
||||
|
||||
# Holds additional configuration values that get merged into the default
|
||||
# configuration (see `matrix_meshtastic_relay_configuration_default`).
|
||||
# configuration (see `matrix_bridge_meshtastic_relay_configuration_default`).
|
||||
#
|
||||
# If you need something more special, you can take full control by changing
|
||||
# `matrix_meshtastic_relay_configuration` directly.
|
||||
matrix_meshtastic_relay_configuration_extension_yaml: |
|
||||
# `matrix_bridge_meshtastic_relay_configuration` directly.
|
||||
matrix_bridge_meshtastic_relay_configuration_extension_yaml: |
|
||||
# Your custom YAML configuration goes here.
|
||||
# This configuration extends the default starting configuration (`matrix_meshtastic_relay_configuration_default`).
|
||||
# This configuration extends the default starting configuration (`matrix_bridge_meshtastic_relay_configuration_default`).
|
||||
#
|
||||
# You can override individual variables from the default configuration, or introduce new ones.
|
||||
#
|
||||
# If you need something more special, you can take full control by
|
||||
# redefining `matrix_meshtastic_relay_configuration` directly.
|
||||
# redefining `matrix_bridge_meshtastic_relay_configuration` directly.
|
||||
|
||||
matrix_meshtastic_relay_configuration_extension: "{{ matrix_meshtastic_relay_configuration_extension_yaml | from_yaml if matrix_meshtastic_relay_configuration_extension_yaml | from_yaml is mapping else {} }}"
|
||||
matrix_bridge_meshtastic_relay_configuration_extension: "{{ matrix_bridge_meshtastic_relay_configuration_extension_yaml | from_yaml if matrix_bridge_meshtastic_relay_configuration_extension_yaml | from_yaml is mapping else {} }}"
|
||||
|
||||
# Holds the final configuration rendered to `config.yaml`.
|
||||
# Normally, you don't need to change this variable — use
|
||||
# `matrix_meshtastic_relay_configuration_extension_yaml` instead.
|
||||
matrix_meshtastic_relay_configuration: "{{ matrix_meshtastic_relay_configuration_default | combine(matrix_meshtastic_relay_configuration_extension, recursive=True) }}"
|
||||
# `matrix_bridge_meshtastic_relay_configuration_extension_yaml` instead.
|
||||
matrix_bridge_meshtastic_relay_configuration: "{{ matrix_bridge_meshtastic_relay_configuration_default | combine(matrix_bridge_meshtastic_relay_configuration_extension, recursive=True) }}"
|
||||
|
||||
# matrix_meshtastic_relay_restart_necessary controls whether the service
|
||||
# matrix_bridge_meshtastic_relay_restart_necessary controls whether the service
|
||||
# will be restarted (when true) or merely started (when false) by the
|
||||
# systemd service manager role (when conditional restart is enabled).
|
||||
#
|
||||
@@ -198,4 +198,4 @@ matrix_meshtastic_relay_configuration: "{{ matrix_meshtastic_relay_configuration
|
||||
# any configuration files, the systemd service file, or the container image changed.
|
||||
# The default of `false` means "no restart needed" — appropriate when the role's
|
||||
# installation tasks haven't run (e.g., due to --tags skipping them).
|
||||
matrix_meshtastic_relay_restart_necessary: false
|
||||
matrix_bridge_meshtastic_relay_restart_necessary: false
|
||||
|
||||
@@ -11,15 +11,15 @@
|
||||
- install-all
|
||||
- install-meshtastic-relay
|
||||
block:
|
||||
- when: matrix_meshtastic_relay_enabled | bool
|
||||
- when: matrix_bridge_meshtastic_relay_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
|
||||
- when: matrix_meshtastic_relay_enabled | bool
|
||||
- when: matrix_bridge_meshtastic_relay_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
|
||||
- tags:
|
||||
- setup-all
|
||||
- setup-meshtastic-relay
|
||||
block:
|
||||
- when: not matrix_meshtastic_relay_enabled | bool
|
||||
- when: not matrix_bridge_meshtastic_relay_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
|
||||
- name: Ensure matrix-meshtastic-relay image is pulled
|
||||
community.docker.docker_image_pull:
|
||||
name: "{{ matrix_meshtastic_relay_container_image }}"
|
||||
name: "{{ matrix_bridge_meshtastic_relay_container_image }}"
|
||||
pull: always
|
||||
register: matrix_meshtastic_relay_container_image_pull_result
|
||||
register: matrix_bridge_meshtastic_relay_container_image_pull_result
|
||||
retries: "{{ devture_playbook_help_container_retries_count }}"
|
||||
delay: "{{ devture_playbook_help_container_retries_delay }}"
|
||||
until: matrix_meshtastic_relay_container_image_pull_result is not failed
|
||||
until: matrix_bridge_meshtastic_relay_container_image_pull_result is not failed
|
||||
|
||||
- name: Ensure matrix-meshtastic-relay paths exist
|
||||
ansible.builtin.file:
|
||||
@@ -22,26 +22,26 @@
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
with_items:
|
||||
- "{{ matrix_meshtastic_relay_base_path }}"
|
||||
- "{{ matrix_meshtastic_relay_config_path }}"
|
||||
- "{{ matrix_meshtastic_relay_data_path }}"
|
||||
- "{{ matrix_bridge_meshtastic_relay_base_path }}"
|
||||
- "{{ matrix_bridge_meshtastic_relay_config_path }}"
|
||||
- "{{ matrix_bridge_meshtastic_relay_data_path }}"
|
||||
|
||||
- name: Ensure matrix-meshtastic-relay config.yaml is installed
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_meshtastic_relay_configuration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_meshtastic_relay_config_path }}/config.yaml"
|
||||
content: "{{ matrix_bridge_meshtastic_relay_configuration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_bridge_meshtastic_relay_config_path }}/config.yaml"
|
||||
mode: '0600'
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
register: matrix_meshtastic_relay_config_result
|
||||
register: matrix_bridge_meshtastic_relay_config_result
|
||||
|
||||
- name: Ensure matrix-meshtastic-relay container network is created
|
||||
when:
|
||||
- matrix_meshtastic_relay_connection_type != 'ble'
|
||||
- matrix_meshtastic_relay_container_network != 'host'
|
||||
- matrix_bridge_meshtastic_relay_connection_type != 'ble'
|
||||
- matrix_bridge_meshtastic_relay_container_network != 'host'
|
||||
community.general.docker_network:
|
||||
enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
|
||||
name: "{{ matrix_meshtastic_relay_container_network }}"
|
||||
name: "{{ matrix_bridge_meshtastic_relay_container_network }}"
|
||||
driver: bridge
|
||||
driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
|
||||
|
||||
@@ -50,13 +50,13 @@
|
||||
src: "{{ role_path }}/templates/systemd/matrix-meshtastic-relay.service.j2"
|
||||
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-meshtastic-relay.service"
|
||||
mode: '0644'
|
||||
register: matrix_meshtastic_relay_systemd_service_result
|
||||
register: matrix_bridge_meshtastic_relay_systemd_service_result
|
||||
|
||||
- name: Determine whether matrix-meshtastic-relay needs a restart
|
||||
ansible.builtin.set_fact:
|
||||
matrix_meshtastic_relay_restart_necessary: >-
|
||||
matrix_bridge_meshtastic_relay_restart_necessary: >-
|
||||
{{
|
||||
matrix_meshtastic_relay_config_result.changed | default(false)
|
||||
or matrix_meshtastic_relay_systemd_service_result.changed | default(false)
|
||||
or matrix_meshtastic_relay_container_image_pull_result.changed | default(false)
|
||||
matrix_bridge_meshtastic_relay_config_result.changed | default(false)
|
||||
or matrix_bridge_meshtastic_relay_systemd_service_result.changed | default(false)
|
||||
or matrix_bridge_meshtastic_relay_container_image_pull_result.changed | default(false)
|
||||
}}
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
- name: Check existence of matrix-meshtastic-relay service
|
||||
ansible.builtin.stat:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-meshtastic-relay.service"
|
||||
register: matrix_meshtastic_relay_service_stat
|
||||
register: matrix_bridge_meshtastic_relay_service_stat
|
||||
|
||||
- when: matrix_meshtastic_relay_service_stat.stat.exists | bool
|
||||
- when: matrix_bridge_meshtastic_relay_service_stat.stat.exists | bool
|
||||
block:
|
||||
- name: Ensure matrix-meshtastic-relay is stopped
|
||||
ansible.builtin.service:
|
||||
|
||||
@@ -11,16 +11,16 @@
|
||||
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_meshtastic_relay_matrix_host', when: true}
|
||||
- {'name': 'matrix_meshtastic_relay_matrix_bot_password', when: true}
|
||||
- {'name': 'matrix_meshtastic_relay_connection_type', when: true}
|
||||
- {'name': 'matrix_bridge_meshtastic_relay_matrix_host', when: true}
|
||||
- {'name': 'matrix_bridge_meshtastic_relay_matrix_bot_password', when: true}
|
||||
- {'name': 'matrix_bridge_meshtastic_relay_connection_type', when: true}
|
||||
|
||||
- name: Fail if matrix_meshtastic_relay_connection_type is invalid
|
||||
- name: Fail if matrix_bridge_meshtastic_relay_connection_type is invalid
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
`matrix_meshtastic_relay_connection_type` must be one of: `tcp`, `serial`, `ble`.
|
||||
Got: `{{ matrix_meshtastic_relay_connection_type }}`.
|
||||
when: "matrix_meshtastic_relay_connection_type not in ['tcp', 'serial', 'ble']"
|
||||
`matrix_bridge_meshtastic_relay_connection_type` must be one of: `tcp`, `serial`, `ble`.
|
||||
Got: `{{ matrix_bridge_meshtastic_relay_connection_type }}`.
|
||||
when: "matrix_bridge_meshtastic_relay_connection_type not in ['tcp', 'serial', 'ble']"
|
||||
|
||||
- name: (Deprecation) Catch and report renamed matrix-meshtastic-relay variables
|
||||
ansible.builtin.fail:
|
||||
@@ -28,4 +28,4 @@
|
||||
The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead.
|
||||
when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0"
|
||||
with_items:
|
||||
- {'old': 'matrix_meshtastic_relay_container_image_force_pull', 'new': '<removed> (the new community.docker.docker_image_pull module handles this natively)'}
|
||||
- {'old': 'matrix_bridge_meshtastic_relay_container_image_force_pull', 'new': '<removed> (the new community.docker.docker_image_pull module handles this natively)'}
|
||||
|
||||
+12
-12
@@ -1,11 +1,11 @@
|
||||
#jinja2: lstrip_blocks: True
|
||||
[Unit]
|
||||
Description=Matrix <-> Meshtastic bridge
|
||||
{% for service in matrix_meshtastic_relay_systemd_required_services_list %}
|
||||
{% for service in matrix_bridge_meshtastic_relay_systemd_required_services_list %}
|
||||
Requires={{ service }}
|
||||
After={{ service }}
|
||||
{% endfor %}
|
||||
{% for service in matrix_meshtastic_relay_systemd_wanted_services_list %}
|
||||
{% for service in matrix_bridge_meshtastic_relay_systemd_wanted_services_list %}
|
||||
Wants={{ service }}
|
||||
{% endfor %}
|
||||
DefaultDependencies=no
|
||||
@@ -25,26 +25,26 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
|
||||
--read-only \
|
||||
--tmpfs=/tmp:rw,noexec,nosuid,size=50m \
|
||||
--tmpfs=/.cache:rw,noexec,nosuid,size=50m \
|
||||
--mount type=bind,src={{ matrix_meshtastic_relay_config_path }},dst=/config,ro \
|
||||
--mount type=bind,src={{ matrix_meshtastic_relay_data_path }},dst=/data \
|
||||
{% if matrix_meshtastic_relay_connection_type == 'ble' %}
|
||||
--mount type=bind,src={{ matrix_bridge_meshtastic_relay_config_path }},dst=/config,ro \
|
||||
--mount type=bind,src={{ matrix_bridge_meshtastic_relay_data_path }},dst=/data \
|
||||
{% if matrix_bridge_meshtastic_relay_connection_type == 'ble' %}
|
||||
--network=host \
|
||||
--security-opt apparmor=unconfined \
|
||||
--mount type=bind,src=/var/run/dbus,dst=/var/run/dbus,ro \
|
||||
{% else %}
|
||||
--network={{ matrix_meshtastic_relay_container_network }} \
|
||||
--network={{ matrix_bridge_meshtastic_relay_container_network }} \
|
||||
{% endif %}
|
||||
{% if matrix_meshtastic_relay_connection_type == 'serial' %}
|
||||
--device={{ matrix_meshtastic_relay_serial_port }} \
|
||||
{% if matrix_bridge_meshtastic_relay_connection_type == 'serial' %}
|
||||
--device={{ matrix_bridge_meshtastic_relay_serial_port }} \
|
||||
{% endif %}
|
||||
{% for arg in matrix_meshtastic_relay_container_extra_arguments %}
|
||||
{% for arg in matrix_bridge_meshtastic_relay_container_extra_arguments %}
|
||||
{{ arg }} \
|
||||
{% endfor %}
|
||||
{{ matrix_meshtastic_relay_container_image }} \
|
||||
{{ matrix_bridge_meshtastic_relay_container_image }} \
|
||||
mmrelay --config /config/config.yaml
|
||||
|
||||
{% if matrix_meshtastic_relay_container_network != 'host' %}
|
||||
{% for network in matrix_meshtastic_relay_container_additional_networks %}
|
||||
{% if matrix_bridge_meshtastic_relay_container_network != 'host' %}
|
||||
{% for network in matrix_bridge_meshtastic_relay_container_additional_networks %}
|
||||
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-meshtastic-relay
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user