Rename matrix_sms_bridge_* variables to matrix_bridge_sms_*

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:
Slavi Pantaleev
2026-07-16 15:00:45 +03:00
parent 267d578393
commit a77b8f6eab
8 changed files with 147 additions and 147 deletions
@@ -21,23 +21,23 @@ The bridge uses [android-sms-gateway-server](https://github.com/RebekkaMa/androi
To enable the bridge, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file: To enable the bridge, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
```yaml ```yaml
matrix_sms_bridge_enabled: true matrix_bridge_sms_enabled: true
# (optional but recommended) a room ID to a default room # (optional but recommended) a room ID to a default room
matrix_sms_bridge_default_room: "" matrix_bridge_sms_default_room: ""
# (optional but recommended) configure your server location # (optional but recommended) configure your server location
matrix_sms_bridge_default_region: DE matrix_bridge_sms_default_region: DE
matrix_sms_bridge_default_timezone: Europe/Berlin matrix_bridge_sms_default_timezone: Europe/Berlin
# Settings to connect to android-sms-gateway-server # Settings to connect to android-sms-gateway-server
matrix_sms_bridge_provider_android_baseurl: https://192.168.24.24:9090 matrix_bridge_sms_provider_android_baseurl: https://192.168.24.24:9090
matrix_sms_bridge_provider_android_username: admin matrix_bridge_sms_provider_android_username: admin
matrix_sms_bridge_provider_android_password: supeSecretPassword matrix_bridge_sms_provider_android_password: supeSecretPassword
# (optional) if your android-sms-gateway-server uses a self signed vertificate, the bridge needs a "truststore". This can be the certificate itself. # (optional) if your android-sms-gateway-server uses a self signed vertificate, the bridge needs a "truststore". This can be the certificate itself.
matrix_sms_bridge_provider_android_truststore_local_path: android-sms-gateway-server.p12 matrix_bridge_sms_provider_android_truststore_local_path: android-sms-gateway-server.p12
matrix_sms_bridge_provider_android_truststore_password: 123 matrix_bridge_sms_provider_android_truststore_password: 123
``` ```
### Extending the configuration ### Extending the configuration
@@ -46,7 +46,7 @@ There are some additional things you may wish to configure about the bridge.
Take a look at: Take a look at:
- `roles/custom/matrix-bridge-sms/defaults/main.yml` for some variables that you can customize via your `vars.yml` file. You can override settings (even those that don't have dedicated playbook variables) using the `matrix_sms_bridge_configuration_extension_yaml` variable - `roles/custom/matrix-bridge-sms/defaults/main.yml` for some variables that you can customize via your `vars.yml` file. You can override settings (even those that don't have dedicated playbook variables) using the `matrix_bridge_sms_configuration_extension_yaml` variable
## Installing ## Installing
+14 -14
View File
@@ -144,7 +144,7 @@ matrix_homeserver_container_extra_arguments_auto: |
+ +
(['--mount type=bind,src=' + matrix_bridge_mx_puppet_steam_config_path + '/registration.yaml,dst=/matrix-mx-puppet-steam-registration.yaml,ro'] if matrix_bridge_mx_puppet_steam_enabled else []) (['--mount type=bind,src=' + matrix_bridge_mx_puppet_steam_config_path + '/registration.yaml,dst=/matrix-mx-puppet-steam-registration.yaml,ro'] if matrix_bridge_mx_puppet_steam_enabled else [])
+ +
(['--mount type=bind,src=' + matrix_sms_bridge_config_path + '/registration.yaml,dst=/matrix-sms-bridge-registration.yaml,ro'] if matrix_sms_bridge_enabled else []) (['--mount type=bind,src=' + matrix_bridge_sms_config_path + '/registration.yaml,dst=/matrix-sms-bridge-registration.yaml,ro'] if matrix_bridge_sms_enabled else [])
+ +
(['--mount type=bind,src=' + matrix_steam_bridge_config_path + '/registration.yaml,dst=/matrix-steam-bridge-registration.yaml,ro'] if matrix_steam_bridge_enabled else []) (['--mount type=bind,src=' + matrix_steam_bridge_config_path + '/registration.yaml,dst=/matrix-steam-bridge-registration.yaml,ro'] if matrix_steam_bridge_enabled else [])
+ +
@@ -203,7 +203,7 @@ matrix_homeserver_app_service_config_files_auto: |
+ +
(['/matrix-mx-puppet-steam-registration.yaml'] if matrix_bridge_mx_puppet_steam_enabled else []) (['/matrix-mx-puppet-steam-registration.yaml'] if matrix_bridge_mx_puppet_steam_enabled else [])
+ +
(['/matrix-sms-bridge-registration.yaml'] if matrix_sms_bridge_enabled else []) (['/matrix-sms-bridge-registration.yaml'] if matrix_bridge_sms_enabled else [])
+ +
(['/matrix-cactus-comments.yaml'] if matrix_cactus_comments_enabled else []) (['/matrix-cactus-comments.yaml'] if matrix_cactus_comments_enabled else [])
+ +
@@ -541,9 +541,9 @@ devture_systemd_service_manager_services_list_auto: |
([{ ([{
'name': 'matrix-sms-bridge.service', 'name': 'matrix-sms-bridge.service',
'priority': 2000, 'priority': 2000,
'restart_necessary': (matrix_sms_bridge_restart_necessary | bool), 'restart_necessary': (matrix_bridge_sms_restart_necessary | bool),
'groups': ['matrix', 'bridges', 'sms'], 'groups': ['matrix', 'bridges', 'sms'],
}] if matrix_sms_bridge_enabled else []) }] if matrix_bridge_sms_enabled else [])
+ +
([{ ([{
'name': 'matrix-steam-bridge.service', 'name': 'matrix-steam-bridge.service',
@@ -2486,27 +2486,27 @@ matrix_bridge_mautrix_whatsapp_database_password: "{{ (matrix_homeserver_generic
###################################################################### ######################################################################
# We don't enable bridges by default. # We don't enable bridges by default.
matrix_sms_bridge_enabled: false matrix_bridge_sms_enabled: false
matrix_sms_bridge_systemd_required_services_list_auto: | matrix_bridge_sms_systemd_required_services_list_auto: |
{{ {{
matrix_addons_homeserver_systemd_services_list matrix_addons_homeserver_systemd_services_list
}} }}
matrix_sms_bridge_container_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_sms_bridge_container_image_registry_prefix_upstream_default }}" matrix_bridge_sms_container_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_bridge_sms_container_image_registry_prefix_upstream_default }}"
matrix_sms_bridge_container_network: "{{ matrix_addons_container_network }}" matrix_bridge_sms_container_network: "{{ matrix_addons_container_network }}"
matrix_sms_bridge_container_additional_networks_auto: |- matrix_bridge_sms_container_additional_networks_auto: |-
{{ {{
([] if matrix_addons_homeserver_container_network == '' else [matrix_addons_homeserver_container_network]) ([] if matrix_addons_homeserver_container_network == '' else [matrix_addons_homeserver_container_network])
}} }}
matrix_sms_bridge_appservice_token: "{{ (matrix_homeserver_generic_secret_key + ':sms.as.token') | hash('sha512') | to_uuid }}" matrix_bridge_sms_appservice_token: "{{ (matrix_homeserver_generic_secret_key + ':sms.as.token') | hash('sha512') | to_uuid }}"
matrix_sms_bridge_homeserver_hostname: "{{ (matrix_homeserver_container_client_api_endpoint | split(':'))[0] }}" matrix_bridge_sms_homeserver_hostname: "{{ (matrix_homeserver_container_client_api_endpoint | split(':'))[0] }}"
matrix_sms_bridge_homeserver_port: "{{ (matrix_homeserver_container_client_api_endpoint | split(':'))[1] }}" matrix_bridge_sms_homeserver_port: "{{ (matrix_homeserver_container_client_api_endpoint | split(':'))[1] }}"
matrix_sms_bridge_homeserver_token: "{{ (matrix_homeserver_generic_secret_key + ':sms.hs.token') | hash('sha512') | to_uuid }}" matrix_bridge_sms_homeserver_token: "{{ (matrix_homeserver_generic_secret_key + ':sms.hs.token') | hash('sha512') | to_uuid }}"
###################################################################### ######################################################################
# #
@@ -5201,7 +5201,7 @@ matrix_ketesa_config_asManagedUsers_auto: |
([ ([
'^@smsbot:'+(matrix_domain | regex_escape)+'$', '^@smsbot:'+(matrix_domain | regex_escape)+'$',
'^@sms_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', '^@sms_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$',
] if matrix_sms_bridge_enabled else []) ] if matrix_bridge_sms_enabled else [])
+ +
([ ([
'^@'+(matrix_wechat_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$', '^@'+(matrix_wechat_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$',
@@ -12,61 +12,61 @@
# matrix-sms-bridge is a Matrix <-> SMS bridge # matrix-sms-bridge is a Matrix <-> SMS bridge
# Project source code URL: https://github.com/benkuly/matrix-sms-bridge # Project source code URL: https://github.com/benkuly/matrix-sms-bridge
matrix_sms_bridge_enabled: true matrix_bridge_sms_enabled: true
# renovate: datasource=docker depName=folivonet/matrix-sms-bridge # renovate: datasource=docker depName=folivonet/matrix-sms-bridge
matrix_sms_bridge_version: 0.5.13 matrix_bridge_sms_version: 0.5.13
matrix_sms_bridge_container_image: "{{ matrix_sms_bridge_container_image_registry_prefix }}folivonet/matrix-sms-bridge:{{ matrix_sms_bridge_container_image_tag }}" matrix_bridge_sms_container_image: "{{ matrix_bridge_sms_container_image_registry_prefix }}folivonet/matrix-sms-bridge:{{ matrix_bridge_sms_container_image_tag }}"
matrix_sms_bridge_container_image_registry_prefix: "{{ matrix_sms_bridge_container_image_registry_prefix_upstream }}" matrix_bridge_sms_container_image_registry_prefix: "{{ matrix_bridge_sms_container_image_registry_prefix_upstream }}"
matrix_sms_bridge_container_image_registry_prefix_upstream: "{{ matrix_sms_bridge_container_image_registry_prefix_upstream_default }}" matrix_bridge_sms_container_image_registry_prefix_upstream: "{{ matrix_bridge_sms_container_image_registry_prefix_upstream_default }}"
matrix_sms_bridge_container_image_registry_prefix_upstream_default: "docker.io/" matrix_bridge_sms_container_image_registry_prefix_upstream_default: "docker.io/"
matrix_sms_bridge_container_image_tag: "{{ matrix_sms_bridge_version }}" matrix_bridge_sms_container_image_tag: "{{ matrix_bridge_sms_version }}"
matrix_sms_bridge_base_path: "{{ matrix_base_data_path }}/matrix-sms-bridge" matrix_bridge_sms_base_path: "{{ matrix_base_data_path }}/matrix-sms-bridge"
matrix_sms_bridge_config_path: "{{ matrix_base_data_path }}/matrix-sms-bridge/config" matrix_bridge_sms_config_path: "{{ matrix_base_data_path }}/matrix-sms-bridge/config"
matrix_sms_bridge_data_path: "{{ matrix_base_data_path }}/matrix-sms-bridge/data" matrix_bridge_sms_data_path: "{{ matrix_base_data_path }}/matrix-sms-bridge/data"
matrix_sms_bridge_appservice_token: '' matrix_bridge_sms_appservice_token: ''
matrix_sms_bridge_homeserver_token: '' matrix_bridge_sms_homeserver_token: ''
matrix_sms_bridge_container_http_host_bind_port: '' matrix_bridge_sms_container_http_host_bind_port: ''
matrix_sms_bridge_container_network: "" matrix_bridge_sms_container_network: ""
matrix_sms_bridge_container_additional_networks: "{{ matrix_sms_bridge_container_additional_networks_auto + matrix_sms_bridge_container_additional_networks_custom }}" matrix_bridge_sms_container_additional_networks: "{{ matrix_bridge_sms_container_additional_networks_auto + matrix_bridge_sms_container_additional_networks_custom }}"
matrix_sms_bridge_container_additional_networks_auto: [] matrix_bridge_sms_container_additional_networks_auto: []
matrix_sms_bridge_container_additional_networks_custom: [] matrix_bridge_sms_container_additional_networks_custom: []
# A list of extra arguments to pass to the container # A list of extra arguments to pass to the container
matrix_sms_bridge_container_extra_arguments: [] matrix_bridge_sms_container_extra_arguments: []
# List of systemd services that service depends on. # List of systemd services that service depends on.
matrix_sms_bridge_systemd_required_services_list: "{{ matrix_sms_bridge_systemd_required_services_list_default + matrix_sms_bridge_systemd_required_services_list_auto + matrix_sms_bridge_systemd_required_services_list_custom }}" matrix_bridge_sms_systemd_required_services_list: "{{ matrix_bridge_sms_systemd_required_services_list_default + matrix_bridge_sms_systemd_required_services_list_auto + matrix_bridge_sms_systemd_required_services_list_custom }}"
matrix_sms_bridge_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}" matrix_bridge_sms_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
matrix_sms_bridge_systemd_required_services_list_auto: [] matrix_bridge_sms_systemd_required_services_list_auto: []
matrix_sms_bridge_systemd_required_services_list_custom: [] matrix_bridge_sms_systemd_required_services_list_custom: []
# List of systemd services that service wants # List of systemd services that service wants
matrix_sms_bridge_systemd_wanted_services_list: [] matrix_bridge_sms_systemd_wanted_services_list: []
matrix_sms_bridge_appservice_url: 'http://matrix-sms-bridge:8080' matrix_bridge_sms_appservice_url: 'http://matrix-sms-bridge:8080'
matrix_sms_bridge_homeserver_hostname: '' matrix_bridge_sms_homeserver_hostname: ''
matrix_sms_bridge_homeserver_port: "" matrix_bridge_sms_homeserver_port: ""
matrix_sms_bridge_homserver_domain: "{{ matrix_domain }}" matrix_bridge_sms_homserver_domain: "{{ matrix_domain }}"
matrix_sms_bridge_default_room: '' matrix_bridge_sms_default_room: ''
matrix_sms_bridge_default_region: '' matrix_bridge_sms_default_region: ''
matrix_sms_bridge_default_timezone: '' matrix_bridge_sms_default_timezone: ''
matrix_sms_bridge_single_mode_enabled: false matrix_bridge_sms_single_mode_enabled: false
matrix_sms_bridge_provider_android_baseurl: '' matrix_bridge_sms_provider_android_baseurl: ''
matrix_sms_bridge_provider_android_username: '' matrix_bridge_sms_provider_android_username: ''
matrix_sms_bridge_provider_android_password: '' matrix_bridge_sms_provider_android_password: ''
matrix_sms_bridge_provider_android_truststore_local_path: '' matrix_bridge_sms_provider_android_truststore_local_path: ''
matrix_sms_bridge_provider_android_truststore_password: '' matrix_bridge_sms_provider_android_truststore_password: ''
matrix_sms_bridge_configuration_yaml: | matrix_bridge_sms_configuration_yaml: |
#jinja2: lstrip_blocks: True #jinja2: lstrip_blocks: True
# Database connection # Database connection
@@ -75,30 +75,30 @@ matrix_sms_bridge_configuration_yaml: |
sms: sms:
# (optional) SMS messages without a valid token a routed to this room. # (optional) SMS messages without a valid token a routed to this room.
# Note that you must invite @smsbot:yourHomeServer to this room. # Note that you must invite @smsbot:yourHomeServer to this room.
defaultRoomId: "{{ matrix_sms_bridge_default_room }}" defaultRoomId: "{{ matrix_bridge_sms_default_room }}"
defaultRegion: "{{ matrix_sms_bridge_default_region }}" defaultRegion: "{{ matrix_bridge_sms_default_region }}"
defaultTimeZone: "{{ matrix_sms_bridge_default_timezone }}" defaultTimeZone: "{{ matrix_bridge_sms_default_timezone }}"
singleModeEnabled: "{{ matrix_sms_bridge_single_mode_enabled }}" singleModeEnabled: "{{ matrix_bridge_sms_single_mode_enabled }}"
provider: provider:
android: android:
# (optional) default is disabled # (optional) default is disabled
enabled: true enabled: true
# The url to the android-sms-gateway-server # The url to the android-sms-gateway-server
baseUrl: {{ matrix_sms_bridge_provider_android_baseurl }} baseUrl: {{ matrix_bridge_sms_provider_android_baseurl }}
# The username of the gateway # The username of the gateway
username: {{ matrix_sms_bridge_provider_android_username }} username: {{ matrix_bridge_sms_provider_android_username }}
# The password of the gateway # The password of the gateway
password: {{ matrix_sms_bridge_provider_android_password }} password: {{ matrix_bridge_sms_provider_android_password }}
# (optional) if you use a self signed certificate, you can add the public key here # (optional) if you use a self signed certificate, you can add the public key here
{% if matrix_sms_bridge_provider_android_truststore_local_path %} {% if matrix_bridge_sms_provider_android_truststore_local_path %}
trustStore: trustStore:
path: /config/matrix-sms-gateway-server.p12 path: /config/matrix-sms-gateway-server.p12
password: {{ matrix_sms_bridge_provider_android_truststore_password }} password: {{ matrix_bridge_sms_provider_android_truststore_password }}
type: PKCS12 type: PKCS12
{% endif %} {% endif %}
bot: bot:
# The domain-part of matrix-ids. E. g. example.org when your userIds look like @unicorn:example.org # The domain-part of matrix-ids. E. g. example.org when your userIds look like @unicorn:example.org
serverName: {{ matrix_sms_bridge_homserver_domain }} serverName: {{ matrix_bridge_sms_homserver_domain }}
migration: migration:
url: "jdbc:h2:file:/data/database/db" url: "jdbc:h2:file:/data/database/db"
username: sa username: sa
@@ -108,48 +108,48 @@ matrix_sms_bridge_configuration_yaml: |
client: client:
homeServer: homeServer:
# The hostname of your Homeserver. # The hostname of your Homeserver.
hostname: {{ matrix_sms_bridge_homeserver_hostname }} hostname: {{ matrix_bridge_sms_homeserver_hostname }}
# (optional) The port of your Homeserver. Default is 443. # (optional) The port of your Homeserver. Default is 443.
port: {{ matrix_sms_bridge_homeserver_port }} port: {{ matrix_bridge_sms_homeserver_port }}
# (optional) Use http or https. Default is true (so uses https). # (optional) Use http or https. Default is true (so uses https).
secure: false secure: false
# The token to authenticate against the Homeserver. # The token to authenticate against the Homeserver.
token: {{ matrix_sms_bridge_appservice_token }} token: {{ matrix_bridge_sms_appservice_token }}
appservice: appservice:
# A unique token for Homeservers to use to authenticate requests to this application service. # A unique token for Homeservers to use to authenticate requests to this application service.
hsToken: {{ matrix_sms_bridge_homeserver_token }} hsToken: {{ matrix_bridge_sms_homeserver_token }}
matrix_sms_bridge_configuration_extension_yaml: | matrix_bridge_sms_configuration_extension_yaml: |
# Your custom YAML configuration goes here. # Your custom YAML configuration goes here.
# This configuration extends the default starting configuration (`matrix_sms_bridge_configuration_yaml`). # This configuration extends the default starting configuration (`matrix_bridge_sms_configuration_yaml`).
# #
# You can override individual variables from the default configuration, or introduce new ones. # 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 # If you need something more special, you can take full control by
# completely redefining `matrix_sms_bridge_configuration_yaml`. # completely redefining `matrix_bridge_sms_configuration_yaml`.
matrix_sms_bridge_configuration_extension: "{{ matrix_sms_bridge_configuration_extension_yaml | from_yaml if matrix_sms_bridge_configuration_extension_yaml | from_yaml is mapping else {} }}" matrix_bridge_sms_configuration_extension: "{{ matrix_bridge_sms_configuration_extension_yaml | from_yaml if matrix_bridge_sms_configuration_extension_yaml | from_yaml is mapping else {} }}"
matrix_sms_bridge_configuration: "{{ matrix_sms_bridge_configuration_yaml | from_yaml | combine(matrix_sms_bridge_configuration_extension, recursive=True) }}" matrix_bridge_sms_configuration: "{{ matrix_bridge_sms_configuration_yaml | from_yaml | combine(matrix_bridge_sms_configuration_extension, recursive=True) }}"
matrix_sms_bridge_registration_yaml: | matrix_bridge_sms_registration_yaml: |
id: sms id: sms
as_token: "{{ matrix_sms_bridge_appservice_token }}" as_token: "{{ matrix_bridge_sms_appservice_token }}"
hs_token: "{{ matrix_sms_bridge_homeserver_token }}" hs_token: "{{ matrix_bridge_sms_homeserver_token }}"
namespaces: namespaces:
users: users:
- exclusive: true - exclusive: true
regex: '^@sms_.+:{{ matrix_sms_bridge_homserver_domain | regex_escape }}$' regex: '^@sms_.+:{{ matrix_bridge_sms_homserver_domain | regex_escape }}$'
aliases: aliases:
- exclusive: true - exclusive: true
regex: '^#sms_.+:{{ matrix_sms_bridge_homserver_domain | regex_escape }}$' regex: '^#sms_.+:{{ matrix_bridge_sms_homserver_domain | regex_escape }}$'
url: {{ matrix_sms_bridge_appservice_url }} url: {{ matrix_bridge_sms_appservice_url }}
sender_localpart: smsbot sender_localpart: smsbot
rate_limited: false rate_limited: false
matrix_sms_bridge_registration: "{{ matrix_sms_bridge_registration_yaml | from_yaml }}" matrix_bridge_sms_registration: "{{ matrix_bridge_sms_registration_yaml | from_yaml }}"
# matrix_sms_bridge_restart_necessary controls whether the service # matrix_bridge_sms_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the # will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled). # systemd service manager role (when conditional restart is enabled).
# #
@@ -157,4 +157,4 @@ matrix_sms_bridge_registration: "{{ matrix_sms_bridge_registration_yaml | from_y
# any configuration files, the systemd service file, or the container image changed. # 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 # 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). # installation tasks haven't run (e.g., due to --tags skipping them).
matrix_sms_bridge_restart_necessary: false matrix_bridge_sms_restart_necessary: false
@@ -12,15 +12,15 @@
- install-all - install-all
- install-matrix-sms-bridge - install-matrix-sms-bridge
block: block:
- when: matrix_sms_bridge_enabled | bool - when: matrix_bridge_sms_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml" ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
- when: matrix_sms_bridge_enabled | bool - when: matrix_bridge_sms_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml" ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
- tags: - tags:
- setup-all - setup-all
- setup-matrix-sms-bridge - setup-matrix-sms-bridge
block: block:
- when: not matrix_sms_bridge_enabled | bool - when: not matrix_bridge_sms_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
@@ -12,12 +12,12 @@
- name: Ensure matrix-sms-bridge image is pulled - name: Ensure matrix-sms-bridge image is pulled
community.docker.docker_image_pull: community.docker.docker_image_pull:
name: "{{ matrix_sms_bridge_container_image }}" name: "{{ matrix_bridge_sms_container_image }}"
pull: always pull: always
register: matrix_sms_bridge_container_image_pull_result register: matrix_bridge_sms_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}" retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}" delay: "{{ devture_playbook_help_container_retries_delay }}"
until: matrix_sms_bridge_container_image_pull_result is not failed until: matrix_bridge_sms_container_image_pull_result is not failed
- name: Ensure matrix-sms-bridge paths exist - name: Ensure matrix-sms-bridge paths exist
ansible.builtin.file: ansible.builtin.file:
@@ -27,43 +27,43 @@
owner: "{{ matrix_user_name }}" owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}" group: "{{ matrix_group_name }}"
with_items: with_items:
- "{{ matrix_sms_bridge_base_path }}" - "{{ matrix_bridge_sms_base_path }}"
- "{{ matrix_sms_bridge_config_path }}" - "{{ matrix_bridge_sms_config_path }}"
- "{{ matrix_sms_bridge_data_path }}" - "{{ matrix_bridge_sms_data_path }}"
- name: Ensure matrix-sms-bridge application.yml installed - name: Ensure matrix-sms-bridge application.yml installed
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_sms_bridge_configuration | to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_bridge_sms_configuration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_sms_bridge_config_path }}/application.yml" dest: "{{ matrix_bridge_sms_config_path }}/application.yml"
mode: '0644' mode: '0644'
owner: "{{ matrix_user_name }}" owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}" group: "{{ matrix_group_name }}"
register: matrix_sms_bridge_config_result register: matrix_bridge_sms_config_result
- name: Ensure matrix-sms-bridge registration.yaml installed - name: Ensure matrix-sms-bridge registration.yaml installed
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_sms_bridge_registration | to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_bridge_sms_registration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_sms_bridge_config_path }}/registration.yaml" dest: "{{ matrix_bridge_sms_config_path }}/registration.yaml"
mode: '0644' mode: '0644'
owner: "{{ matrix_user_name }}" owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}" group: "{{ matrix_group_name }}"
register: matrix_sms_bridge_registration_result register: matrix_bridge_sms_registration_result
- name: Ensure android-sms-gateway-server cert installed - name: Ensure android-sms-gateway-server cert installed
ansible.builtin.copy: ansible.builtin.copy:
src: "{{ matrix_sms_bridge_provider_android_truststore_local_path }}" src: "{{ matrix_bridge_sms_provider_android_truststore_local_path }}"
dest: "{{ matrix_sms_bridge_config_path }}/matrix-sms-gateway-server.p12" dest: "{{ matrix_bridge_sms_config_path }}/matrix-sms-gateway-server.p12"
mode: '0644' mode: '0644'
owner: "{{ matrix_user_name }}" owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}" group: "{{ matrix_group_name }}"
when: matrix_sms_bridge_provider_android_truststore_local_path != "" when: matrix_bridge_sms_provider_android_truststore_local_path != ""
register: matrix_sms_bridge_cert_result register: matrix_bridge_sms_cert_result
- name: Ensure matrix-sms-bridge container network is created - name: Ensure matrix-sms-bridge container network is created
when: matrix_sms_bridge_container_network != 'host' when: matrix_bridge_sms_container_network != 'host'
community.general.docker_network: community.general.docker_network:
enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
name: "{{ matrix_sms_bridge_container_network }}" name: "{{ matrix_bridge_sms_container_network }}"
driver: bridge driver: bridge
driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
@@ -72,15 +72,15 @@
src: "{{ role_path }}/templates/systemd/matrix-sms-bridge.service.j2" src: "{{ role_path }}/templates/systemd/matrix-sms-bridge.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-sms-bridge.service" dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-sms-bridge.service"
mode: '0644' mode: '0644'
register: matrix_sms_bridge_systemd_service_result register: matrix_bridge_sms_systemd_service_result
- name: Determine whether matrix-sms-bridge needs a restart - name: Determine whether matrix-sms-bridge needs a restart
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_sms_bridge_restart_necessary: >- matrix_bridge_sms_restart_necessary: >-
{{ {{
matrix_sms_bridge_config_result.changed | default(false) matrix_bridge_sms_config_result.changed | default(false)
or matrix_sms_bridge_registration_result.changed | default(false) or matrix_bridge_sms_registration_result.changed | default(false)
or matrix_sms_bridge_cert_result.changed | default(false) or matrix_bridge_sms_cert_result.changed | default(false)
or matrix_sms_bridge_systemd_service_result.changed | default(false) or matrix_bridge_sms_systemd_service_result.changed | default(false)
or matrix_sms_bridge_container_image_pull_result.changed | default(false) or matrix_bridge_sms_container_image_pull_result.changed | default(false)
}} }}
@@ -9,7 +9,7 @@
- name: Check existence of matrix-sms-bridge service - name: Check existence of matrix-sms-bridge service
ansible.builtin.stat: ansible.builtin.stat:
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-sms-bridge.service" path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-sms-bridge.service"
register: matrix_sms_bridge_service_stat register: matrix_bridge_sms_service_stat
- name: Ensure matrix-sms-bridge is stopped - name: Ensure matrix-sms-bridge is stopped
ansible.builtin.service: ansible.builtin.service:
@@ -17,10 +17,10 @@
state: stopped state: stopped
enabled: false enabled: false
daemon_reload: true daemon_reload: true
when: "matrix_sms_bridge_service_stat.stat.exists" when: "matrix_bridge_sms_service_stat.stat.exists"
- name: Ensure matrix-sms-bridge.service doesn't exist - name: Ensure matrix-sms-bridge.service doesn't exist
ansible.builtin.file: ansible.builtin.file:
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-sms-bridge.service" path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-sms-bridge.service"
state: absent state: absent
when: "matrix_sms_bridge_service_stat.stat.exists" when: "matrix_bridge_sms_service_stat.stat.exists"
@@ -14,12 +14,12 @@
Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml). 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" when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0"
with_items: with_items:
- {'old': 'matrix_sms_bridge_docker_image', 'new': 'matrix_sms_bridge_container_image'} - {'old': 'matrix_bridge_sms_docker_image', 'new': 'matrix_bridge_sms_container_image'}
- {'old': 'matrix_sms_bridge_docker_image_registry_prefix', 'new': 'matrix_sms_bridge_container_image_registry_prefix'} - {'old': 'matrix_bridge_sms_docker_image_registry_prefix', 'new': 'matrix_bridge_sms_container_image_registry_prefix'}
- {'old': 'matrix_sms_bridge_docker_image_registry_prefix_upstream', 'new': 'matrix_sms_bridge_container_image_registry_prefix_upstream'} - {'old': 'matrix_bridge_sms_docker_image_registry_prefix_upstream', 'new': 'matrix_bridge_sms_container_image_registry_prefix_upstream'}
- {'old': 'matrix_sms_bridge_docker_image_registry_prefix_upstream_default', 'new': 'matrix_sms_bridge_container_image_registry_prefix_upstream_default'} - {'old': 'matrix_bridge_sms_docker_image_registry_prefix_upstream_default', 'new': 'matrix_bridge_sms_container_image_registry_prefix_upstream_default'}
- {'old': 'matrix_sms_bridge_docker_image_tag', 'new': 'matrix_sms_bridge_container_image_tag'} - {'old': 'matrix_bridge_sms_docker_image_tag', 'new': 'matrix_bridge_sms_container_image_tag'}
- {'old': 'matrix_sms_bridge_container_image_force_pull', 'new': '<removed> (the new community.docker.docker_image_pull module handles this natively)'} - {'old': 'matrix_bridge_sms_container_image_force_pull', 'new': '<removed> (the new community.docker.docker_image_pull module handles this natively)'}
- name: Fail if required matrix-bridge-sms settings not defined - name: Fail if required matrix-bridge-sms settings not defined
@@ -28,13 +28,13 @@
You need to define a required configuration setting (`{{ item }}`). You need to define a required configuration setting (`{{ item }}`).
when: "lookup('vars', item, default='') == ''" when: "lookup('vars', item, default='') == ''"
with_items: with_items:
- "matrix_sms_bridge_appservice_token" - "matrix_bridge_sms_appservice_token"
- "matrix_sms_bridge_homeserver_hostname" - "matrix_bridge_sms_homeserver_hostname"
- "matrix_sms_bridge_homeserver_port" - "matrix_bridge_sms_homeserver_port"
- "matrix_sms_bridge_homeserver_token" - "matrix_bridge_sms_homeserver_token"
- "matrix_sms_bridge_default_region" - "matrix_bridge_sms_default_region"
- "matrix_sms_bridge_default_timezone" - "matrix_bridge_sms_default_timezone"
- "matrix_sms_bridge_provider_android_baseurl" - "matrix_bridge_sms_provider_android_baseurl"
- "matrix_sms_bridge_provider_android_username" - "matrix_bridge_sms_provider_android_username"
- "matrix_sms_bridge_provider_android_password" - "matrix_bridge_sms_provider_android_password"
- "matrix_sms_bridge_container_network" - "matrix_bridge_sms_container_network"
@@ -1,11 +1,11 @@
#jinja2: lstrip_blocks: True #jinja2: lstrip_blocks: True
[Unit] [Unit]
Description=Matrix sms bridge Description=Matrix sms bridge
{% for service in matrix_sms_bridge_systemd_required_services_list %} {% for service in matrix_bridge_sms_systemd_required_services_list %}
Requires={{ service }} Requires={{ service }}
After={{ service }} After={{ service }}
{% endfor %} {% endfor %}
{% for service in matrix_sms_bridge_systemd_wanted_services_list %} {% for service in matrix_bridge_sms_systemd_wanted_services_list %}
Wants={{ service }} Wants={{ service }}
{% endfor %} {% endfor %}
DefaultDependencies=no DefaultDependencies=no
@@ -22,20 +22,20 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
--log-driver=none \ --log-driver=none \
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \ --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
--cap-drop=ALL \ --cap-drop=ALL \
--network={{ matrix_sms_bridge_container_network }} \ --network={{ matrix_bridge_sms_container_network }} \
{% if matrix_sms_bridge_container_http_host_bind_port %} {% if matrix_bridge_sms_container_http_host_bind_port %}
-p {{ matrix_sms_bridge_container_http_host_bind_port }}:8080 \ -p {{ matrix_bridge_sms_container_http_host_bind_port }}:8080 \
{% endif %} {% endif %}
--mount type=bind,src={{ matrix_sms_bridge_config_path }},dst=/config \ --mount type=bind,src={{ matrix_bridge_sms_config_path }},dst=/config \
--mount type=bind,src={{ matrix_sms_bridge_data_path }},dst=/data \ --mount type=bind,src={{ matrix_bridge_sms_data_path }},dst=/data \
--env SPRING_CONFIG_ADDITIONAL_LOCATION=/config/application.yml \ --env SPRING_CONFIG_ADDITIONAL_LOCATION=/config/application.yml \
{% for arg in matrix_sms_bridge_container_extra_arguments %} {% for arg in matrix_bridge_sms_container_extra_arguments %}
{{ arg }} \ {{ arg }} \
{% endfor %} {% endfor %}
{{ matrix_sms_bridge_container_image }} {{ matrix_bridge_sms_container_image }}
{% if matrix_sms_bridge_container_network != 'host' %} {% if matrix_bridge_sms_container_network != 'host' %}
{% for network in matrix_sms_bridge_container_additional_networks %} {% for network in matrix_bridge_sms_container_additional_networks %}
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-sms-bridge ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-sms-bridge
{% endfor %} {% endfor %}
{% endif %} {% endif %}