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>pull/5434/head
| @@ -20,7 +20,7 @@ See the project's [documentation](https://codeberg.org/icewind/mx-puppet-steam/b | |||||
| To enable the [Steam](https://steampowered.com/) bridge, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file: | To enable the [Steam](https://steampowered.com/) bridge, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file: | ||||
| ```yaml | ```yaml | ||||
| matrix_mx_puppet_steam_enabled: true | |||||
| matrix_bridge_mx_puppet_steam_enabled: true | |||||
| ``` | ``` | ||||
| ## Installing | ## Installing | ||||
| @@ -142,7 +142,7 @@ matrix_homeserver_container_extra_arguments_auto: | | |||||
| + | + | ||||
| (['--mount type=bind,src=' + matrix_bridge_mx_puppet_groupme_config_path + '/registration.yaml,dst=/matrix-mx-puppet-groupme-registration.yaml,ro'] if matrix_bridge_mx_puppet_groupme_enabled else []) | (['--mount type=bind,src=' + matrix_bridge_mx_puppet_groupme_config_path + '/registration.yaml,dst=/matrix-mx-puppet-groupme-registration.yaml,ro'] if matrix_bridge_mx_puppet_groupme_enabled else []) | ||||
| + | + | ||||
| (['--mount type=bind,src=' + matrix_mx_puppet_steam_config_path + '/registration.yaml,dst=/matrix-mx-puppet-steam-registration.yaml,ro'] if matrix_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_sms_bridge_config_path + '/registration.yaml,dst=/matrix-sms-bridge-registration.yaml,ro'] if matrix_sms_bridge_enabled else []) | ||||
| + | + | ||||
| @@ -201,7 +201,7 @@ matrix_homeserver_app_service_config_files_auto: | | |||||
| + | + | ||||
| (['/matrix-mx-puppet-groupme-registration.yaml'] if matrix_bridge_mx_puppet_groupme_enabled else []) | (['/matrix-mx-puppet-groupme-registration.yaml'] if matrix_bridge_mx_puppet_groupme_enabled else []) | ||||
| + | + | ||||
| (['/matrix-mx-puppet-steam-registration.yaml'] if matrix_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_sms_bridge_enabled else []) | ||||
| + | + | ||||
| @@ -527,9 +527,9 @@ devture_systemd_service_manager_services_list_auto: | | |||||
| ([{ | ([{ | ||||
| 'name': 'matrix-mx-puppet-steam.service', | 'name': 'matrix-mx-puppet-steam.service', | ||||
| 'priority': 2000, | 'priority': 2000, | ||||
| 'restart_necessary': (matrix_mx_puppet_steam_restart_necessary | bool), | |||||
| 'restart_necessary': (matrix_bridge_mx_puppet_steam_restart_necessary | bool), | |||||
| 'groups': ['matrix', 'bridges', 'mx-puppet-steam'], | 'groups': ['matrix', 'bridges', 'mx-puppet-steam'], | ||||
| }] if matrix_mx_puppet_steam_enabled else []) | |||||
| }] if matrix_bridge_mx_puppet_steam_enabled else []) | |||||
| + | + | ||||
| ([{ | ([{ | ||||
| 'name': 'matrix-postmoogle.service', | 'name': 'matrix-postmoogle.service', | ||||
| @@ -2672,43 +2672,43 @@ matrix_bridge_meshtastic_relay_container_additional_networks_auto: | | |||||
| ###################################################################### | ###################################################################### | ||||
| # We don't enable bridges by default. | # We don't enable bridges by default. | ||||
| matrix_mx_puppet_steam_enabled: false | |||||
| matrix_bridge_mx_puppet_steam_enabled: false | |||||
| matrix_mx_puppet_steam_systemd_required_services_list_auto: | | |||||
| matrix_bridge_mx_puppet_steam_systemd_required_services_list_auto: | | |||||
| {{ | {{ | ||||
| matrix_addons_homeserver_systemd_services_list | matrix_addons_homeserver_systemd_services_list | ||||
| + | + | ||||
| ([postgres_identifier ~ '.service'] if (postgres_enabled and matrix_mx_puppet_steam_database_hostname == postgres_connection_hostname) else []) | |||||
| ([postgres_identifier ~ '.service'] if (postgres_enabled and matrix_bridge_mx_puppet_steam_database_hostname == postgres_connection_hostname) else []) | |||||
| }} | }} | ||||
| matrix_mx_puppet_steam_container_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_mx_puppet_steam_container_image_registry_prefix_upstream_default }}" | |||||
| matrix_bridge_mx_puppet_steam_container_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_bridge_mx_puppet_steam_container_image_registry_prefix_upstream_default }}" | |||||
| matrix_mx_puppet_steam_container_image_self_build: "{{ matrix_architecture not in ['arm64', 'amd64'] }}" | |||||
| matrix_bridge_mx_puppet_steam_container_image_self_build: "{{ matrix_architecture not in ['arm64', 'amd64'] }}" | |||||
| matrix_mx_puppet_steam_container_network: "{{ matrix_addons_container_network }}" | |||||
| matrix_bridge_mx_puppet_steam_container_network: "{{ matrix_addons_container_network }}" | |||||
| matrix_mx_puppet_steam_container_additional_networks_auto: |- | |||||
| matrix_bridge_mx_puppet_steam_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]) | ||||
| + | + | ||||
| ([postgres_container_network] if (postgres_enabled and matrix_mx_puppet_steam_database_hostname == postgres_connection_hostname and matrix_mx_puppet_steam_container_network != postgres_container_network) else []) | |||||
| ([postgres_container_network] if (postgres_enabled and matrix_bridge_mx_puppet_steam_database_hostname == postgres_connection_hostname and matrix_bridge_mx_puppet_steam_container_network != postgres_container_network) else []) | |||||
| ) | unique | ) | unique | ||||
| }} | }} | ||||
| matrix_mx_puppet_steam_appservice_token: "{{ (matrix_homeserver_generic_secret_key + ':mxste.as.tok') | hash('sha512') | to_uuid }}" | |||||
| matrix_bridge_mx_puppet_steam_appservice_token: "{{ (matrix_homeserver_generic_secret_key + ':mxste.as.tok') | hash('sha512') | to_uuid }}" | |||||
| matrix_mx_puppet_steam_homeserver_address: "{{ matrix_addons_homeserver_client_api_url }}" | |||||
| matrix_mx_puppet_steam_homeserver_token: "{{ (matrix_homeserver_generic_secret_key + ':mxste.hs.tok') | hash('sha512') | to_uuid }}" | |||||
| matrix_bridge_mx_puppet_steam_homeserver_address: "{{ matrix_addons_homeserver_client_api_url }}" | |||||
| matrix_bridge_mx_puppet_steam_homeserver_token: "{{ (matrix_homeserver_generic_secret_key + ':mxste.hs.tok') | hash('sha512') | to_uuid }}" | |||||
| matrix_mx_puppet_steam_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}" | |||||
| matrix_bridge_mx_puppet_steam_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}" | |||||
| matrix_mx_puppet_steam_presence_enabled: "{{ matrix_homeserver_implementation != 'synapse' or matrix_synapse_presence_enabled }}" | |||||
| matrix_bridge_mx_puppet_steam_presence_enabled: "{{ matrix_homeserver_implementation != 'synapse' or matrix_synapse_presence_enabled }}" | |||||
| # Postgres is the default, except if not using internal Postgres server | # Postgres is the default, except if not using internal Postgres server | ||||
| matrix_mx_puppet_steam_database_engine: "{{ 'postgres' if postgres_enabled else 'sqlite' }}" | |||||
| matrix_mx_puppet_steam_database_hostname: "{{ postgres_connection_hostname if postgres_enabled else '' }}" | |||||
| matrix_mx_puppet_steam_database_password: "{{ (matrix_homeserver_generic_secret_key + ':mxpup.steam.db') | hash('sha512') | to_uuid }}" | |||||
| matrix_bridge_mx_puppet_steam_database_engine: "{{ 'postgres' if postgres_enabled else 'sqlite' }}" | |||||
| matrix_bridge_mx_puppet_steam_database_hostname: "{{ postgres_connection_hostname if postgres_enabled else '' }}" | |||||
| matrix_bridge_mx_puppet_steam_database_password: "{{ (matrix_homeserver_generic_secret_key + ':mxpup.steam.db') | hash('sha512') | to_uuid }}" | |||||
| ###################################################################### | ###################################################################### | ||||
| # | # | ||||
| @@ -4255,10 +4255,10 @@ postgres_managed_databases_auto: | | |||||
| }] if (matrix_bridge_mautrix_slack_enabled and matrix_bridge_mautrix_slack_database_engine == 'postgres' and matrix_bridge_mautrix_slack_database_hostname == postgres_connection_hostname) else []) | }] if (matrix_bridge_mautrix_slack_enabled and matrix_bridge_mautrix_slack_database_engine == 'postgres' and matrix_bridge_mautrix_slack_database_hostname == postgres_connection_hostname) else []) | ||||
| + | + | ||||
| ([{ | ([{ | ||||
| 'name': matrix_mx_puppet_steam_database_name, | |||||
| 'username': matrix_mx_puppet_steam_database_username, | |||||
| 'password': matrix_mx_puppet_steam_database_password, | |||||
| }] if (matrix_mx_puppet_steam_enabled and matrix_mx_puppet_steam_database_engine == 'postgres' and matrix_mx_puppet_steam_database_hostname == postgres_connection_hostname) else []) | |||||
| 'name': matrix_bridge_mx_puppet_steam_database_name, | |||||
| 'username': matrix_bridge_mx_puppet_steam_database_username, | |||||
| 'password': matrix_bridge_mx_puppet_steam_database_password, | |||||
| }] if (matrix_bridge_mx_puppet_steam_enabled and matrix_bridge_mx_puppet_steam_database_engine == 'postgres' and matrix_bridge_mx_puppet_steam_database_hostname == postgres_connection_hostname) else []) | |||||
| + | + | ||||
| ([{ | ([{ | ||||
| 'name': matrix_bridge_mx_puppet_groupme_database_name, | 'name': matrix_bridge_mx_puppet_groupme_database_name, | ||||
| @@ -5196,7 +5196,7 @@ matrix_ketesa_config_asManagedUsers_auto: | | |||||
| + | + | ||||
| ([ | ([ | ||||
| '^@_steampuppet_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', | '^@_steampuppet_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$', | ||||
| ] if matrix_mx_puppet_steam_enabled else []) | |||||
| ] if matrix_bridge_mx_puppet_steam_enabled else []) | |||||
| + | + | ||||
| ([ | ([ | ||||
| '^@smsbot:'+(matrix_domain | regex_escape)+'$', | '^@smsbot:'+(matrix_domain | regex_escape)+'$', | ||||
| @@ -13,131 +13,131 @@ | |||||
| # Mx Puppet Steam is a Matrix <-> Steam bridge | # Mx Puppet Steam is a Matrix <-> Steam bridge | ||||
| # Project source code URL: https://github.com/icewind1991/mx-puppet-steam | # Project source code URL: https://github.com/icewind1991/mx-puppet-steam | ||||
| matrix_mx_puppet_steam_enabled: true | |||||
| matrix_bridge_mx_puppet_steam_enabled: true | |||||
| matrix_mx_puppet_steam_container_image_self_build: false | |||||
| matrix_mx_puppet_steam_container_image_self_build_repo: "https://github.com/icewind1991/mx-puppet-steam.git" | |||||
| matrix_mx_puppet_steam_container_image_self_build_repo_version: "{{ 'master' if matrix_mx_puppet_steam_version == 'latest' else matrix_mx_puppet_steam_version }}" | |||||
| matrix_bridge_mx_puppet_steam_container_image_self_build: false | |||||
| matrix_bridge_mx_puppet_steam_container_image_self_build_repo: "https://github.com/icewind1991/mx-puppet-steam.git" | |||||
| matrix_bridge_mx_puppet_steam_container_image_self_build_repo_version: "{{ 'master' if matrix_bridge_mx_puppet_steam_version == 'latest' else matrix_bridge_mx_puppet_steam_version }}" | |||||
| # Controls whether the mx-puppet-steam container exposes its HTTP port (tcp/8432 in the container). | # Controls whether the mx-puppet-steam container exposes its HTTP port (tcp/8432 in the container). | ||||
| # | # | ||||
| # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8432"), or empty string to not expose. | # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8432"), or empty string to not expose. | ||||
| matrix_mx_puppet_steam_container_http_host_bind_port: '' | |||||
| matrix_bridge_mx_puppet_steam_container_http_host_bind_port: '' | |||||
| # renovate: datasource=docker depName=icewind1991/mx-puppet-steam | # renovate: datasource=docker depName=icewind1991/mx-puppet-steam | ||||
| matrix_mx_puppet_steam_version: latest | |||||
| matrix_mx_puppet_steam_container_image: "{{ matrix_mx_puppet_steam_container_image_registry_prefix }}icewind1991/mx-puppet-steam:{{ matrix_mx_puppet_steam_version }}" | |||||
| matrix_mx_puppet_steam_container_image_registry_prefix: "{{ 'localhost/' if matrix_mx_puppet_steam_container_image_self_build else matrix_mx_puppet_steam_container_image_registry_prefix_upstream }}" | |||||
| matrix_mx_puppet_steam_container_image_registry_prefix_upstream: "{{ matrix_mx_puppet_steam_container_image_registry_prefix_upstream_default }}" | |||||
| matrix_mx_puppet_steam_container_image_registry_prefix_upstream_default: "docker.io/" | |||||
| matrix_bridge_mx_puppet_steam_version: latest | |||||
| matrix_bridge_mx_puppet_steam_container_image: "{{ matrix_bridge_mx_puppet_steam_container_image_registry_prefix }}icewind1991/mx-puppet-steam:{{ matrix_bridge_mx_puppet_steam_version }}" | |||||
| matrix_bridge_mx_puppet_steam_container_image_registry_prefix: "{{ 'localhost/' if matrix_bridge_mx_puppet_steam_container_image_self_build else matrix_bridge_mx_puppet_steam_container_image_registry_prefix_upstream }}" | |||||
| matrix_bridge_mx_puppet_steam_container_image_registry_prefix_upstream: "{{ matrix_bridge_mx_puppet_steam_container_image_registry_prefix_upstream_default }}" | |||||
| matrix_bridge_mx_puppet_steam_container_image_registry_prefix_upstream_default: "docker.io/" | |||||
| matrix_mx_puppet_steam_base_path: "{{ matrix_base_data_path }}/mx-puppet-steam" | |||||
| matrix_mx_puppet_steam_config_path: "{{ matrix_mx_puppet_steam_base_path }}/config" | |||||
| matrix_mx_puppet_steam_data_path: "{{ matrix_mx_puppet_steam_base_path }}/data" | |||||
| matrix_mx_puppet_steam_container_src_files_path: "{{ matrix_mx_puppet_steam_base_path }}/docker-src" | |||||
| matrix_bridge_mx_puppet_steam_base_path: "{{ matrix_base_data_path }}/mx-puppet-steam" | |||||
| matrix_bridge_mx_puppet_steam_config_path: "{{ matrix_bridge_mx_puppet_steam_base_path }}/config" | |||||
| matrix_bridge_mx_puppet_steam_data_path: "{{ matrix_bridge_mx_puppet_steam_base_path }}/data" | |||||
| matrix_bridge_mx_puppet_steam_container_src_files_path: "{{ matrix_bridge_mx_puppet_steam_base_path }}/docker-src" | |||||
| matrix_mx_puppet_steam_appservice_port: "8432" | |||||
| matrix_bridge_mx_puppet_steam_appservice_port: "8432" | |||||
| matrix_mx_puppet_steam_homeserver_address: "" | |||||
| matrix_mx_puppet_steam_homeserver_domain: '{{ matrix_domain }}' | |||||
| matrix_mx_puppet_steam_appservice_address: 'http://matrix-mx-puppet-steam:{{ matrix_mx_puppet_steam_appservice_port }}' | |||||
| matrix_bridge_mx_puppet_steam_homeserver_address: "" | |||||
| matrix_bridge_mx_puppet_steam_homeserver_domain: '{{ matrix_domain }}' | |||||
| matrix_bridge_mx_puppet_steam_appservice_address: 'http://matrix-mx-puppet-steam:{{ matrix_bridge_mx_puppet_steam_appservice_port }}' | |||||
| # "@alice:example.com" to allow a specific user | # "@alice:example.com" to allow a specific user | ||||
| # "@.*:example.com" to allow users on a specific homeserver | # "@.*:example.com" to allow users on a specific homeserver | ||||
| # "@.*" to allow anyone | # "@.*" to allow anyone | ||||
| matrix_mx_puppet_steam_provisioning_whitelist: | |||||
| matrix_bridge_mx_puppet_steam_provisioning_whitelist: | |||||
| - "@.*:{{ matrix_domain | regex_escape }}" | - "@.*:{{ matrix_domain | regex_escape }}" | ||||
| # Leave empty to disable blacklist | # Leave empty to disable blacklist | ||||
| # "@bob:example.com" to disallow a specific user | # "@bob:example.com" to disallow a specific user | ||||
| # "@.*:example.com" to disallow users on a specific homeserver | # "@.*:example.com" to disallow users on a specific homeserver | ||||
| matrix_mx_puppet_steam_provisioning_blacklist: [] | |||||
| matrix_bridge_mx_puppet_steam_provisioning_blacklist: [] | |||||
| matrix_mx_puppet_steam_container_network: "" | |||||
| matrix_bridge_mx_puppet_steam_container_network: "" | |||||
| matrix_mx_puppet_steam_container_additional_networks: "{{ matrix_mx_puppet_steam_container_additional_networks_auto + matrix_mx_puppet_steam_container_additional_networks_custom }}" | |||||
| matrix_mx_puppet_steam_container_additional_networks_auto: [] | |||||
| matrix_mx_puppet_steam_container_additional_networks_custom: [] | |||||
| matrix_bridge_mx_puppet_steam_container_additional_networks: "{{ matrix_bridge_mx_puppet_steam_container_additional_networks_auto + matrix_bridge_mx_puppet_steam_container_additional_networks_custom }}" | |||||
| matrix_bridge_mx_puppet_steam_container_additional_networks_auto: [] | |||||
| matrix_bridge_mx_puppet_steam_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_mx_puppet_steam_container_extra_arguments: [] | |||||
| matrix_bridge_mx_puppet_steam_container_extra_arguments: [] | |||||
| # List of systemd services that matrix-puppet-steam.service depends on. | # List of systemd services that matrix-puppet-steam.service depends on. | ||||
| matrix_mx_puppet_steam_systemd_required_services_list: "{{ matrix_mx_puppet_steam_systemd_required_services_list_default + matrix_mx_puppet_steam_systemd_required_services_list_auto + matrix_mx_puppet_steam_systemd_required_services_list_custom }}" | |||||
| matrix_mx_puppet_steam_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}" | |||||
| matrix_mx_puppet_steam_systemd_required_services_list_auto: [] | |||||
| matrix_mx_puppet_steam_systemd_required_services_list_custom: [] | |||||
| matrix_bridge_mx_puppet_steam_systemd_required_services_list: "{{ matrix_bridge_mx_puppet_steam_systemd_required_services_list_default + matrix_bridge_mx_puppet_steam_systemd_required_services_list_auto + matrix_bridge_mx_puppet_steam_systemd_required_services_list_custom }}" | |||||
| matrix_bridge_mx_puppet_steam_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}" | |||||
| matrix_bridge_mx_puppet_steam_systemd_required_services_list_auto: [] | |||||
| matrix_bridge_mx_puppet_steam_systemd_required_services_list_custom: [] | |||||
| # List of systemd services that matrix-puppet-steam.service wants | # List of systemd services that matrix-puppet-steam.service wants | ||||
| matrix_mx_puppet_steam_systemd_wanted_services_list: [] | |||||
| matrix_bridge_mx_puppet_steam_systemd_wanted_services_list: [] | |||||
| matrix_mx_puppet_steam_appservice_token: '' | |||||
| matrix_mx_puppet_steam_homeserver_token: '' | |||||
| matrix_bridge_mx_puppet_steam_appservice_token: '' | |||||
| matrix_bridge_mx_puppet_steam_homeserver_token: '' | |||||
| # Can be set to enable automatic double-puppeting via Shared Secret Auth (https://github.com/devture/matrix-synapse-shared-secret-auth). | # Can be set to enable automatic double-puppeting via Shared Secret Auth (https://github.com/devture/matrix-synapse-shared-secret-auth). | ||||
| matrix_mx_puppet_steam_login_shared_secret: '' | |||||
| matrix_bridge_mx_puppet_steam_login_shared_secret: '' | |||||
| matrix_mx_puppet_steam_presence_enabled: true | |||||
| matrix_mx_puppet_steam_presence_interval: 5000 | |||||
| matrix_bridge_mx_puppet_steam_presence_enabled: true | |||||
| matrix_bridge_mx_puppet_steam_presence_interval: 5000 | |||||
| matrix_mx_puppet_steam_database_engine: sqlite | |||||
| matrix_bridge_mx_puppet_steam_database_engine: sqlite | |||||
| matrix_mx_puppet_steam_sqlite_database_path_local: "{{ matrix_mx_puppet_steam_data_path }}/database.db" | |||||
| matrix_mx_puppet_steam_sqlite_database_path_in_container: "/data/database.db" | |||||
| matrix_bridge_mx_puppet_steam_sqlite_database_path_local: "{{ matrix_bridge_mx_puppet_steam_data_path }}/database.db" | |||||
| matrix_bridge_mx_puppet_steam_sqlite_database_path_in_container: "/data/database.db" | |||||
| matrix_mx_puppet_steam_database_username: matrix_mx_puppet_steam | |||||
| matrix_mx_puppet_steam_database_password: ~ | |||||
| matrix_mx_puppet_steam_database_hostname: '' | |||||
| matrix_mx_puppet_steam_database_port: 5432 | |||||
| matrix_mx_puppet_steam_database_name: matrix_mx_puppet_steam | |||||
| matrix_mx_puppet_steam_database_sslmode: disable | |||||
| matrix_bridge_mx_puppet_steam_database_username: matrix_mx_puppet_steam | |||||
| matrix_bridge_mx_puppet_steam_database_password: ~ | |||||
| matrix_bridge_mx_puppet_steam_database_hostname: '' | |||||
| matrix_bridge_mx_puppet_steam_database_port: 5432 | |||||
| matrix_bridge_mx_puppet_steam_database_name: matrix_mx_puppet_steam | |||||
| matrix_bridge_mx_puppet_steam_database_sslmode: disable | |||||
| matrix_mx_puppet_steam_database_connection_string: 'postgresql://{{ matrix_mx_puppet_steam_database_username }}:{{ matrix_mx_puppet_steam_database_password }}@{{ matrix_mx_puppet_steam_database_hostname }}:{{ matrix_mx_puppet_steam_database_port }}/{{ matrix_mx_puppet_steam_database_name }}?sslmode={{ matrix_mx_puppet_steam_database_sslmode }}' | |||||
| matrix_bridge_mx_puppet_steam_database_connection_string: 'postgresql://{{ matrix_bridge_mx_puppet_steam_database_username }}:{{ matrix_bridge_mx_puppet_steam_database_password }}@{{ matrix_bridge_mx_puppet_steam_database_hostname }}:{{ matrix_bridge_mx_puppet_steam_database_port }}/{{ matrix_bridge_mx_puppet_steam_database_name }}?sslmode={{ matrix_bridge_mx_puppet_steam_database_sslmode }}' | |||||
| # Default configuration template which covers the generic use case. | # Default configuration template which covers the generic use case. | ||||
| # You can customize it by controlling the various variables inside it. | # You can customize it by controlling the various variables inside it. | ||||
| # | # | ||||
| # For a more advanced customization, you can extend the default (see `matrix_mx_puppet_steam_configuration_extension_yaml`) | |||||
| # For a more advanced customization, you can extend the default (see `matrix_bridge_mx_puppet_steam_configuration_extension_yaml`) | |||||
| # or completely replace this variable with your own template. | # or completely replace this variable with your own template. | ||||
| matrix_mx_puppet_steam_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}" | |||||
| matrix_bridge_mx_puppet_steam_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}" | |||||
| matrix_mx_puppet_steam_configuration_extension_yaml: | | |||||
| matrix_bridge_mx_puppet_steam_configuration_extension_yaml: | | |||||
| # Your custom YAML configuration goes here. | # Your custom YAML configuration goes here. | ||||
| # This configuration extends the default starting configuration (`matrix_mx_puppet_steam_configuration_yaml`). | |||||
| # This configuration extends the default starting configuration (`matrix_bridge_mx_puppet_steam_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_mx_puppet_steam_configuration_yaml`. | |||||
| # completely redefining `matrix_bridge_mx_puppet_steam_configuration_yaml`. | |||||
| matrix_mx_puppet_steam_configuration_extension: "{{ matrix_mx_puppet_steam_configuration_extension_yaml | from_yaml if matrix_mx_puppet_steam_configuration_extension_yaml | from_yaml is mapping else {} }}" | |||||
| matrix_bridge_mx_puppet_steam_configuration_extension: "{{ matrix_bridge_mx_puppet_steam_configuration_extension_yaml | from_yaml if matrix_bridge_mx_puppet_steam_configuration_extension_yaml | from_yaml is mapping else {} }}" | |||||
| # Holds the final configuration (a combination of the default and its extension). | # Holds the final configuration (a combination of the default and its extension). | ||||
| # You most likely don't need to touch this variable. Instead, see `matrix_mx_puppet_steam_configuration_yaml`. | |||||
| matrix_mx_puppet_steam_configuration: "{{ matrix_mx_puppet_steam_configuration_yaml | from_yaml | combine(matrix_mx_puppet_steam_configuration_extension, recursive=True) }}" | |||||
| # You most likely don't need to touch this variable. Instead, see `matrix_bridge_mx_puppet_steam_configuration_yaml`. | |||||
| matrix_bridge_mx_puppet_steam_configuration: "{{ matrix_bridge_mx_puppet_steam_configuration_yaml | from_yaml | combine(matrix_bridge_mx_puppet_steam_configuration_extension, recursive=True) }}" | |||||
| matrix_mx_puppet_steam_registration_yaml: | | |||||
| as_token: "{{ matrix_mx_puppet_steam_appservice_token }}" | |||||
| hs_token: "{{ matrix_mx_puppet_steam_homeserver_token }}" | |||||
| matrix_bridge_mx_puppet_steam_registration_yaml: | | |||||
| as_token: "{{ matrix_bridge_mx_puppet_steam_appservice_token }}" | |||||
| hs_token: "{{ matrix_bridge_mx_puppet_steam_homeserver_token }}" | |||||
| id: steam-puppet | id: steam-puppet | ||||
| namespaces: | namespaces: | ||||
| users: | users: | ||||
| - exclusive: true | - exclusive: true | ||||
| regex: '@_steampuppet_.*:{{ matrix_mx_puppet_steam_homeserver_domain | regex_escape }}' | |||||
| regex: '@_steampuppet_.*:{{ matrix_bridge_mx_puppet_steam_homeserver_domain | regex_escape }}' | |||||
| rooms: [] | rooms: [] | ||||
| aliases: | aliases: | ||||
| - exclusive: true | - exclusive: true | ||||
| regex: '#_steampuppet_.*:{{ matrix_mx_puppet_steam_homeserver_domain | regex_escape }}' | |||||
| regex: '#_steampuppet_.*:{{ matrix_bridge_mx_puppet_steam_homeserver_domain | regex_escape }}' | |||||
| protocols: [] | protocols: [] | ||||
| rate_limited: false | rate_limited: false | ||||
| sender_localpart: _steampuppet_bot | sender_localpart: _steampuppet_bot | ||||
| url: {{ matrix_mx_puppet_steam_appservice_address }} | |||||
| url: {{ matrix_bridge_mx_puppet_steam_appservice_address }} | |||||
| de.sorunome.msc2409.push_ephemeral: true | de.sorunome.msc2409.push_ephemeral: true | ||||
| receive_ephemeral: true | receive_ephemeral: true | ||||
| matrix_mx_puppet_steam_registration: "{{ matrix_mx_puppet_steam_registration_yaml | from_yaml }}" | |||||
| matrix_bridge_mx_puppet_steam_registration: "{{ matrix_bridge_mx_puppet_steam_registration_yaml | from_yaml }}" | |||||
| # matrix_mx_puppet_steam_restart_necessary controls whether the service | |||||
| # matrix_bridge_mx_puppet_steam_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). | ||||
| # | # | ||||
| @@ -145,4 +145,4 @@ matrix_mx_puppet_steam_registration: "{{ matrix_mx_puppet_steam_registration_yam | |||||
| # 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_mx_puppet_steam_restart_necessary: false | |||||
| matrix_bridge_mx_puppet_steam_restart_necessary: false | |||||
| @@ -12,15 +12,15 @@ | |||||
| - install-all | - install-all | ||||
| - install-mx-puppet-steam | - install-mx-puppet-steam | ||||
| block: | block: | ||||
| - when: matrix_mx_puppet_steam_enabled | bool | |||||
| - when: matrix_bridge_mx_puppet_steam_enabled | bool | |||||
| ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml" | ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml" | ||||
| - when: matrix_mx_puppet_steam_enabled | bool | |||||
| - when: matrix_bridge_mx_puppet_steam_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-mx-puppet-steam | - setup-mx-puppet-steam | ||||
| block: | block: | ||||
| - when: not matrix_mx_puppet_steam_enabled | bool | |||||
| - when: not matrix_bridge_mx_puppet_steam_enabled | bool | |||||
| ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" | ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" | ||||
| @@ -20,16 +20,16 @@ | |||||
| owner: "{{ matrix_user_name }}" | owner: "{{ matrix_user_name }}" | ||||
| group: "{{ matrix_group_name }}" | group: "{{ matrix_group_name }}" | ||||
| with_items: | with_items: | ||||
| - {path: "{{ matrix_mx_puppet_steam_base_path }}", when: true} | |||||
| - {path: "{{ matrix_mx_puppet_steam_config_path }}", when: true} | |||||
| - {path: "{{ matrix_mx_puppet_steam_data_path }}", when: true} | |||||
| - {path: "{{ matrix_mx_puppet_steam_container_src_files_path }}", when: "{{ matrix_mx_puppet_steam_container_image_self_build }}"} | |||||
| when: matrix_mx_puppet_steam_enabled | bool and item.when | bool | |||||
| - {path: "{{ matrix_bridge_mx_puppet_steam_base_path }}", when: true} | |||||
| - {path: "{{ matrix_bridge_mx_puppet_steam_config_path }}", when: true} | |||||
| - {path: "{{ matrix_bridge_mx_puppet_steam_data_path }}", when: true} | |||||
| - {path: "{{ matrix_bridge_mx_puppet_steam_container_src_files_path }}", when: "{{ matrix_bridge_mx_puppet_steam_container_image_self_build }}"} | |||||
| when: matrix_bridge_mx_puppet_steam_enabled | bool and item.when | bool | |||||
| - name: Check if an old database file already exists | - name: Check if an old database file already exists | ||||
| ansible.builtin.stat: | ansible.builtin.stat: | ||||
| path: "{{ matrix_mx_puppet_steam_base_path }}/database.db" | |||||
| register: matrix_mx_puppet_steam_stat_database | |||||
| path: "{{ matrix_bridge_mx_puppet_steam_base_path }}/database.db" | |||||
| register: matrix_bridge_mx_puppet_steam_stat_database | |||||
| - name: (Data relocation) Ensure matrix-mx-puppet-steam.service is stopped | - name: (Data relocation) Ensure matrix-mx-puppet-steam.service is stopped | ||||
| ansible.builtin.service: | ansible.builtin.service: | ||||
| @@ -38,96 +38,96 @@ | |||||
| enabled: false | enabled: false | ||||
| daemon_reload: true | daemon_reload: true | ||||
| failed_when: false | failed_when: false | ||||
| when: "matrix_mx_puppet_steam_stat_database.stat.exists" | |||||
| when: "matrix_bridge_mx_puppet_steam_stat_database.stat.exists" | |||||
| - name: (Data relocation) Move mx-puppet-steam database file to ./data directory | - name: (Data relocation) Move mx-puppet-steam database file to ./data directory | ||||
| ansible.builtin.command: | ansible.builtin.command: | ||||
| cmd: "mv {{ matrix_mx_puppet_steam_base_path }}/database.db {{ matrix_mx_puppet_steam_data_path }}/database.db" | |||||
| creates: "{{ matrix_mx_puppet_steam_data_path }}/database.db" | |||||
| removes: "{{ matrix_mx_puppet_steam_base_path }}/database.db" | |||||
| when: "matrix_mx_puppet_steam_stat_database.stat.exists" | |||||
| cmd: "mv {{ matrix_bridge_mx_puppet_steam_base_path }}/database.db {{ matrix_bridge_mx_puppet_steam_data_path }}/database.db" | |||||
| creates: "{{ matrix_bridge_mx_puppet_steam_data_path }}/database.db" | |||||
| removes: "{{ matrix_bridge_mx_puppet_steam_base_path }}/database.db" | |||||
| when: "matrix_bridge_mx_puppet_steam_stat_database.stat.exists" | |||||
| - ansible.builtin.set_fact: | - ansible.builtin.set_fact: | ||||
| matrix_mx_puppet_steam_migration_requires_restart: false | |||||
| matrix_bridge_mx_puppet_steam_migration_requires_restart: false | |||||
| - when: "matrix_mx_puppet_steam_database_engine == 'postgres'" | |||||
| - when: "matrix_bridge_mx_puppet_steam_database_engine == 'postgres'" | |||||
| block: | block: | ||||
| - name: Check if an SQLite database already exists | - name: Check if an SQLite database already exists | ||||
| ansible.builtin.stat: | ansible.builtin.stat: | ||||
| path: "{{ matrix_mx_puppet_steam_sqlite_database_path_local }}" | |||||
| register: matrix_mx_puppet_steam_sqlite_database_path_local_stat_result | |||||
| path: "{{ matrix_bridge_mx_puppet_steam_sqlite_database_path_local }}" | |||||
| register: matrix_bridge_mx_puppet_steam_sqlite_database_path_local_stat_result | |||||
| - when: "matrix_mx_puppet_steam_sqlite_database_path_local_stat_result.stat.exists | bool" | |||||
| - when: "matrix_bridge_mx_puppet_steam_sqlite_database_path_local_stat_result.stat.exists | bool" | |||||
| block: | block: | ||||
| - ansible.builtin.include_role: | - ansible.builtin.include_role: | ||||
| name: galaxy/postgres | name: galaxy/postgres | ||||
| tasks_from: migrate_db_to_postgres | tasks_from: migrate_db_to_postgres | ||||
| vars: | vars: | ||||
| postgres_db_migration_request: | postgres_db_migration_request: | ||||
| src: "{{ matrix_mx_puppet_steam_sqlite_database_path_local }}" | |||||
| dst: "{{ matrix_mx_puppet_steam_database_connection_string }}" | |||||
| src: "{{ matrix_bridge_mx_puppet_steam_sqlite_database_path_local }}" | |||||
| dst: "{{ matrix_bridge_mx_puppet_steam_database_connection_string }}" | |||||
| caller: "{{ role_path | basename }}" | caller: "{{ role_path | basename }}" | ||||
| engine_variable_name: 'matrix_mx_puppet_steam_database_engine' | |||||
| engine_variable_name: 'matrix_bridge_mx_puppet_steam_database_engine' | |||||
| engine_old: 'sqlite' | engine_old: 'sqlite' | ||||
| systemd_services_to_stop: ['matrix-mx-puppet-steam.service'] | systemd_services_to_stop: ['matrix-mx-puppet-steam.service'] | ||||
| - ansible.builtin.set_fact: | - ansible.builtin.set_fact: | ||||
| matrix_mx_puppet_steam_migration_requires_restart: true | |||||
| matrix_bridge_mx_puppet_steam_migration_requires_restart: true | |||||
| - name: Ensure MX Puppet Steam image is pulled | - name: Ensure MX Puppet Steam image is pulled | ||||
| community.docker.docker_image_pull: | community.docker.docker_image_pull: | ||||
| name: "{{ matrix_mx_puppet_steam_container_image }}" | |||||
| name: "{{ matrix_bridge_mx_puppet_steam_container_image }}" | |||||
| pull: always | pull: always | ||||
| when: matrix_mx_puppet_steam_enabled | bool and not matrix_mx_puppet_steam_container_image_self_build | |||||
| register: matrix_mx_puppet_steam_container_image_pull_result | |||||
| when: matrix_bridge_mx_puppet_steam_enabled | bool and not matrix_bridge_mx_puppet_steam_container_image_self_build | |||||
| register: matrix_bridge_mx_puppet_steam_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_mx_puppet_steam_container_image_pull_result is not failed | |||||
| until: matrix_bridge_mx_puppet_steam_container_image_pull_result is not failed | |||||
| - name: Ensure MX Puppet Steam repository is present on self build | - name: Ensure MX Puppet Steam repository is present on self build | ||||
| ansible.builtin.git: | ansible.builtin.git: | ||||
| repo: "{{ matrix_mx_puppet_steam_container_image_self_build_repo }}" | |||||
| version: "{{ matrix_mx_puppet_steam_container_image_self_build_repo_version }}" | |||||
| dest: "{{ matrix_mx_puppet_steam_container_src_files_path }}" | |||||
| repo: "{{ matrix_bridge_mx_puppet_steam_container_image_self_build_repo }}" | |||||
| version: "{{ matrix_bridge_mx_puppet_steam_container_image_self_build_repo_version }}" | |||||
| dest: "{{ matrix_bridge_mx_puppet_steam_container_src_files_path }}" | |||||
| force: "yes" | force: "yes" | ||||
| become: true | become: true | ||||
| become_user: "{{ matrix_user_name }}" | become_user: "{{ matrix_user_name }}" | ||||
| register: matrix_mx_puppet_steam_git_pull_results | |||||
| when: "matrix_mx_puppet_steam_enabled | bool and matrix_mx_puppet_steam_container_image_self_build" | |||||
| register: matrix_bridge_mx_puppet_steam_git_pull_results | |||||
| when: "matrix_bridge_mx_puppet_steam_enabled | bool and matrix_bridge_mx_puppet_steam_container_image_self_build" | |||||
| - name: Ensure MX Puppet Steam Docker image is built | - name: Ensure MX Puppet Steam Docker image is built | ||||
| community.docker.docker_image_build: | community.docker.docker_image_build: | ||||
| name: "{{ matrix_mx_puppet_steam_container_image }}" | |||||
| name: "{{ matrix_bridge_mx_puppet_steam_container_image }}" | |||||
| dockerfile: Dockerfile | dockerfile: Dockerfile | ||||
| path: "{{ matrix_mx_puppet_steam_container_src_files_path }}" | |||||
| path: "{{ matrix_bridge_mx_puppet_steam_container_src_files_path }}" | |||||
| pull: true | pull: true | ||||
| rebuild: "{{ 'always' if matrix_mx_puppet_steam_git_pull_results.changed | bool else 'never' }}" | |||||
| when: "matrix_mx_puppet_steam_enabled | bool and matrix_mx_puppet_steam_container_image_self_build" | |||||
| register: matrix_mx_puppet_steam_container_image_build_result | |||||
| rebuild: "{{ 'always' if matrix_bridge_mx_puppet_steam_git_pull_results.changed | bool else 'never' }}" | |||||
| when: "matrix_bridge_mx_puppet_steam_enabled | bool and matrix_bridge_mx_puppet_steam_container_image_self_build" | |||||
| register: matrix_bridge_mx_puppet_steam_container_image_build_result | |||||
| - name: Ensure mx-puppet-steam config.yaml installed | - name: Ensure mx-puppet-steam config.yaml installed | ||||
| ansible.builtin.copy: | ansible.builtin.copy: | ||||
| content: "{{ matrix_mx_puppet_steam_configuration | to_nice_yaml(indent=2, width=999999) }}" | |||||
| dest: "{{ matrix_mx_puppet_steam_config_path }}/config.yaml" | |||||
| content: "{{ matrix_bridge_mx_puppet_steam_configuration | to_nice_yaml(indent=2, width=999999) }}" | |||||
| dest: "{{ matrix_bridge_mx_puppet_steam_config_path }}/config.yaml" | |||||
| mode: '0644' | mode: '0644' | ||||
| owner: "{{ matrix_user_name }}" | owner: "{{ matrix_user_name }}" | ||||
| group: "{{ matrix_group_name }}" | group: "{{ matrix_group_name }}" | ||||
| register: matrix_mx_puppet_steam_config_result | |||||
| register: matrix_bridge_mx_puppet_steam_config_result | |||||
| - name: Ensure mx-puppet-steam steam-registration.yaml installed | - name: Ensure mx-puppet-steam steam-registration.yaml installed | ||||
| ansible.builtin.copy: | ansible.builtin.copy: | ||||
| content: "{{ matrix_mx_puppet_steam_registration | to_nice_yaml(indent=2, width=999999) }}" | |||||
| dest: "{{ matrix_mx_puppet_steam_config_path }}/registration.yaml" | |||||
| content: "{{ matrix_bridge_mx_puppet_steam_registration | to_nice_yaml(indent=2, width=999999) }}" | |||||
| dest: "{{ matrix_bridge_mx_puppet_steam_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_mx_puppet_steam_registration_result | |||||
| register: matrix_bridge_mx_puppet_steam_registration_result | |||||
| - name: Ensure mx-puppet-steam container network is created | - name: Ensure mx-puppet-steam container network is created | ||||
| when: matrix_mx_puppet_steam_container_network != 'host' | |||||
| when: matrix_bridge_mx_puppet_steam_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_mx_puppet_steam_container_network }}" | |||||
| name: "{{ matrix_bridge_mx_puppet_steam_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 }}" | ||||
| @@ -136,18 +136,18 @@ | |||||
| src: "{{ role_path }}/templates/systemd/matrix-mx-puppet-steam.service.j2" | src: "{{ role_path }}/templates/systemd/matrix-mx-puppet-steam.service.j2" | ||||
| dest: "/etc/systemd/system/matrix-mx-puppet-steam.service" | dest: "/etc/systemd/system/matrix-mx-puppet-steam.service" | ||||
| mode: '0644' | mode: '0644' | ||||
| register: matrix_mx_puppet_steam_systemd_service_result | |||||
| register: matrix_bridge_mx_puppet_steam_systemd_service_result | |||||
| - name: Determine whether matrix-mx-puppet-steam needs a restart | - name: Determine whether matrix-mx-puppet-steam needs a restart | ||||
| ansible.builtin.set_fact: | ansible.builtin.set_fact: | ||||
| matrix_mx_puppet_steam_restart_necessary: >- | |||||
| matrix_bridge_mx_puppet_steam_restart_necessary: >- | |||||
| {{ | {{ | ||||
| matrix_mx_puppet_steam_migration_requires_restart | default(false) | |||||
| or matrix_mx_puppet_steam_config_result.changed | default(false) | |||||
| or matrix_mx_puppet_steam_registration_result.changed | default(false) | |||||
| or matrix_mx_puppet_steam_systemd_service_result.changed | default(false) | |||||
| or matrix_mx_puppet_steam_container_image_pull_result.changed | default(false) | |||||
| or matrix_mx_puppet_steam_container_image_build_result.changed | default(false) | |||||
| matrix_bridge_mx_puppet_steam_migration_requires_restart | default(false) | |||||
| or matrix_bridge_mx_puppet_steam_config_result.changed | default(false) | |||||
| or matrix_bridge_mx_puppet_steam_registration_result.changed | default(false) | |||||
| or matrix_bridge_mx_puppet_steam_systemd_service_result.changed | default(false) | |||||
| or matrix_bridge_mx_puppet_steam_container_image_pull_result.changed | default(false) | |||||
| or matrix_bridge_mx_puppet_steam_container_image_build_result.changed | default(false) | |||||
| }} | }} | ||||
| - name: Ensure matrix-mx-puppet-steam.service restarted, if necessary | - name: Ensure matrix-mx-puppet-steam.service restarted, if necessary | ||||
| @@ -155,4 +155,4 @@ | |||||
| name: "matrix-mx-puppet-steam.service" | name: "matrix-mx-puppet-steam.service" | ||||
| state: restarted | state: restarted | ||||
| daemon_reload: true | daemon_reload: true | ||||
| when: "matrix_mx_puppet_steam_migration_requires_restart | bool" | |||||
| when: "matrix_bridge_mx_puppet_steam_migration_requires_restart | bool" | |||||
| @@ -9,9 +9,9 @@ | |||||
| - name: Check existence of matrix-mx-puppet-steam service | - name: Check existence of matrix-mx-puppet-steam service | ||||
| ansible.builtin.stat: | ansible.builtin.stat: | ||||
| path: "/etc/systemd/system/matrix-mx-puppet-steam.service" | path: "/etc/systemd/system/matrix-mx-puppet-steam.service" | ||||
| register: matrix_mx_puppet_steam_service_stat | |||||
| register: matrix_bridge_mx_puppet_steam_service_stat | |||||
| - when: matrix_mx_puppet_steam_service_stat.stat.exists | bool | |||||
| - when: matrix_bridge_mx_puppet_steam_service_stat.stat.exists | bool | |||||
| block: | block: | ||||
| - name: Ensure matrix-mx-puppet-steam is stopped | - name: Ensure matrix-mx-puppet-steam is stopped | ||||
| ansible.builtin.service: | ansible.builtin.service: | ||||
| @@ -11,14 +11,14 @@ | |||||
| The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead. | The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead. | ||||
| 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_mx_puppet_steam_docker_image_name_prefix', 'new': 'matrix_mx_puppet_steam_container_image_registry_prefix'} | |||||
| - {'old': 'matrix_mx_puppet_steam_docker_image', 'new': 'matrix_mx_puppet_steam_container_image'} | |||||
| - {'old': 'matrix_mx_puppet_steam_docker_image_force_pull', 'new': 'matrix_mx_puppet_steam_container_image_force_pull'} | |||||
| - {'old': 'matrix_mx_puppet_steam_docker_image_registry_prefix', 'new': 'matrix_mx_puppet_steam_container_image_registry_prefix'} | |||||
| - {'old': 'matrix_mx_puppet_steam_docker_image_registry_prefix_upstream', 'new': 'matrix_mx_puppet_steam_container_image_registry_prefix_upstream'} | |||||
| - {'old': 'matrix_mx_puppet_steam_docker_image_registry_prefix_upstream_default', 'new': 'matrix_mx_puppet_steam_container_image_registry_prefix_upstream_default'} | |||||
| - {'old': 'matrix_mx_puppet_steam_docker_src_files_path', 'new': 'matrix_mx_puppet_steam_container_src_files_path'} | |||||
| - {'old': 'matrix_mx_puppet_steam_container_image_force_pull', 'new': '<removed> (the new community.docker.docker_image_pull module handles this natively)'} | |||||
| - {'old': 'matrix_bridge_mx_puppet_steam_docker_image_name_prefix', 'new': 'matrix_bridge_mx_puppet_steam_container_image_registry_prefix'} | |||||
| - {'old': 'matrix_bridge_mx_puppet_steam_docker_image', 'new': 'matrix_bridge_mx_puppet_steam_container_image'} | |||||
| - {'old': 'matrix_bridge_mx_puppet_steam_docker_image_force_pull', 'new': 'matrix_bridge_mx_puppet_steam_container_image_force_pull'} | |||||
| - {'old': 'matrix_bridge_mx_puppet_steam_docker_image_registry_prefix', 'new': 'matrix_bridge_mx_puppet_steam_container_image_registry_prefix'} | |||||
| - {'old': 'matrix_bridge_mx_puppet_steam_docker_image_registry_prefix_upstream', 'new': 'matrix_bridge_mx_puppet_steam_container_image_registry_prefix_upstream'} | |||||
| - {'old': 'matrix_bridge_mx_puppet_steam_docker_image_registry_prefix_upstream_default', 'new': 'matrix_bridge_mx_puppet_steam_container_image_registry_prefix_upstream_default'} | |||||
| - {'old': 'matrix_bridge_mx_puppet_steam_docker_src_files_path', 'new': 'matrix_bridge_mx_puppet_steam_container_src_files_path'} | |||||
| - {'old': 'matrix_bridge_mx_puppet_steam_container_image_force_pull', 'new': '<removed> (the new community.docker.docker_image_pull module handles this natively)'} | |||||
| - name: Fail if required mx-puppet-steam settings not defined | - name: Fail if required mx-puppet-steam settings not defined | ||||
| ansible.builtin.fail: | ansible.builtin.fail: | ||||
| @@ -26,8 +26,8 @@ | |||||
| You need to define a required configuration setting (`{{ item.name }}`). | You need to define a required configuration setting (`{{ item.name }}`). | ||||
| when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" | when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0" | ||||
| with_items: | with_items: | ||||
| - {'name': 'matrix_mx_puppet_steam_appservice_token', when: true} | |||||
| - {'name': 'matrix_mx_puppet_steam_homeserver_address', when: true} | |||||
| - {'name': 'matrix_mx_puppet_steam_homeserver_token', when: true} | |||||
| - {'name': 'matrix_mx_puppet_steam_database_hostname', when: "{{ matrix_mx_puppet_steam_database_engine == 'postgres' }}"} | |||||
| - {'name': 'matrix_mx_puppet_steam_container_network', when: true} | |||||
| - {'name': 'matrix_bridge_mx_puppet_steam_appservice_token', when: true} | |||||
| - {'name': 'matrix_bridge_mx_puppet_steam_homeserver_address', when: true} | |||||
| - {'name': 'matrix_bridge_mx_puppet_steam_homeserver_token', when: true} | |||||
| - {'name': 'matrix_bridge_mx_puppet_steam_database_hostname', when: "{{ matrix_bridge_mx_puppet_steam_database_engine == 'postgres' }}"} | |||||
| - {'name': 'matrix_bridge_mx_puppet_steam_container_network', when: true} | |||||
| @@ -2,16 +2,16 @@ | |||||
| bridge: | bridge: | ||||
| # Port to host the bridge on | # Port to host the bridge on | ||||
| # Used for communication between the homeserver and the bridge | # Used for communication between the homeserver and the bridge | ||||
| port: {{ matrix_mx_puppet_steam_appservice_port }} | |||||
| port: {{ matrix_bridge_mx_puppet_steam_appservice_port }} | |||||
| # The host connections to the bridge's webserver are allowed from | # The host connections to the bridge's webserver are allowed from | ||||
| bindAddress: 0.0.0.0 | bindAddress: 0.0.0.0 | ||||
| # Public domain of the homeserver | # Public domain of the homeserver | ||||
| domain: {{ matrix_mx_puppet_steam_homeserver_domain }} | |||||
| domain: {{ matrix_bridge_mx_puppet_steam_homeserver_domain }} | |||||
| # Reachable URL of the Matrix homeserver | # Reachable URL of the Matrix homeserver | ||||
| homeserverUrl: {{ matrix_mx_puppet_steam_homeserver_address }} | |||||
| {% if matrix_mx_puppet_steam_login_shared_secret != '' %} | |||||
| homeserverUrl: {{ matrix_bridge_mx_puppet_steam_homeserver_address }} | |||||
| {% if matrix_bridge_mx_puppet_steam_login_shared_secret != '' %} | |||||
| loginSharedSecretMap: | loginSharedSecretMap: | ||||
| {{ matrix_domain }}: {{ matrix_mx_puppet_steam_login_shared_secret }} | |||||
| {{ matrix_domain }}: {{ matrix_bridge_mx_puppet_steam_login_shared_secret }} | |||||
| {% endif %} | {% endif %} | ||||
| # Display name of the bridge bot | # Display name of the bridge bot | ||||
| displayname: Steam Puppet Bridge | displayname: Steam Puppet Bridge | ||||
| @@ -23,13 +23,13 @@ bridge: | |||||
| presence: | presence: | ||||
| # Bridge Steam online/offline status | # Bridge Steam online/offline status | ||||
| enabled: {{ matrix_mx_puppet_steam_presence_enabled | to_json }} | |||||
| enabled: {{ matrix_bridge_mx_puppet_steam_presence_enabled | to_json }} | |||||
| # How often to send status to the homeserver in milliseconds | # How often to send status to the homeserver in milliseconds | ||||
| interval: {{ matrix_mx_puppet_steam_presence_interval | to_json }} | |||||
| interval: {{ matrix_bridge_mx_puppet_steam_presence_interval | to_json }} | |||||
| provisioning: | provisioning: | ||||
| # Regex of Matrix IDs allowed to use the puppet bridge | # Regex of Matrix IDs allowed to use the puppet bridge | ||||
| whitelist: {{ matrix_mx_puppet_steam_provisioning_whitelist|to_json }} | |||||
| whitelist: {{ matrix_bridge_mx_puppet_steam_provisioning_whitelist|to_json }} | |||||
| # Allow a specific user | # Allow a specific user | ||||
| #- "@alice:example\\.com" | #- "@alice:example\\.com" | ||||
| # Allow users on a specific homeserver | # Allow users on a specific homeserver | ||||
| @@ -42,7 +42,7 @@ provisioning: | |||||
| #- "@bob:example\\.com" | #- "@bob:example\\.com" | ||||
| # Disallow users on a specific homeserver | # Disallow users on a specific homeserver | ||||
| #- "@.*:example\\.com" | #- "@.*:example\\.com" | ||||
| blacklist: {{ matrix_mx_puppet_steam_provisioning_blacklist|to_json }} | |||||
| blacklist: {{ matrix_bridge_mx_puppet_steam_provisioning_blacklist|to_json }} | |||||
| relay: | relay: | ||||
| # Regex of Matrix IDs who are allowed to use the bridge in relay mode. | # Regex of Matrix IDs who are allowed to use the bridge in relay mode. | ||||
| @@ -50,28 +50,28 @@ relay: | |||||
| # multiple Matrix users | # multiple Matrix users | ||||
| # | # | ||||
| # Same format as in provisioning | # Same format as in provisioning | ||||
| whitelist: {{ matrix_mx_puppet_steam_provisioning_whitelist|to_json }} | |||||
| blacklist: {{ matrix_mx_puppet_steam_provisioning_blacklist|to_json }} | |||||
| whitelist: {{ matrix_bridge_mx_puppet_steam_provisioning_whitelist|to_json }} | |||||
| blacklist: {{ matrix_bridge_mx_puppet_steam_provisioning_blacklist|to_json }} | |||||
| selfService: | selfService: | ||||
| # Regex of Matrix IDs who are allowed to use bridge self-servicing (plumbed rooms) | # Regex of Matrix IDs who are allowed to use bridge self-servicing (plumbed rooms) | ||||
| # | # | ||||
| # Same format as in provisioning | # Same format as in provisioning | ||||
| whitelist: {{ matrix_mx_puppet_steam_provisioning_whitelist|to_json }} | |||||
| blacklist: {{ matrix_mx_puppet_steam_provisioning_blacklist|to_json }} | |||||
| whitelist: {{ matrix_bridge_mx_puppet_steam_provisioning_whitelist|to_json }} | |||||
| blacklist: {{ matrix_bridge_mx_puppet_steam_provisioning_blacklist|to_json }} | |||||
| database: | database: | ||||
| {% if matrix_mx_puppet_steam_database_engine == 'postgres' %} | |||||
| {% if matrix_bridge_mx_puppet_steam_database_engine == 'postgres' %} | |||||
| # Use Postgres as a database backend | # Use Postgres as a database backend | ||||
| # If set, will be used instead of SQLite3 | # If set, will be used instead of SQLite3 | ||||
| # Connection string to connect to the Postgres instance | # Connection string to connect to the Postgres instance | ||||
| # with username "user", password "pass", host "localhost" and database name "dbname". | # with username "user", password "pass", host "localhost" and database name "dbname". | ||||
| # Modify each value as necessary | # Modify each value as necessary | ||||
| connString: {{ matrix_mx_puppet_steam_database_connection_string|to_json }} | |||||
| connString: {{ matrix_bridge_mx_puppet_steam_database_connection_string|to_json }} | |||||
| {% else %} | {% else %} | ||||
| # Use SQLite3 as a database backend | # Use SQLite3 as a database backend | ||||
| # The name of the database file | # The name of the database file | ||||
| filename: {{ matrix_mx_puppet_steam_sqlite_database_path_in_container|to_json }} | |||||
| filename: {{ matrix_bridge_mx_puppet_steam_sqlite_database_path_in_container|to_json }} | |||||
| {% endif %} | {% endif %} | ||||
| logging: | logging: | ||||
| @@ -1,11 +1,11 @@ | |||||
| #jinja2: lstrip_blocks: True | #jinja2: lstrip_blocks: True | ||||
| [Unit] | [Unit] | ||||
| Description=Matrix Mx Puppet Steam bridge | Description=Matrix Mx Puppet Steam bridge | ||||
| {% for service in matrix_mx_puppet_steam_systemd_required_services_list %} | |||||
| {% for service in matrix_bridge_mx_puppet_steam_systemd_required_services_list %} | |||||
| Requires={{ service }} | Requires={{ service }} | ||||
| After={{ service }} | After={{ service }} | ||||
| {% endfor %} | {% endfor %} | ||||
| {% for service in matrix_mx_puppet_steam_systemd_wanted_services_list %} | |||||
| {% for service in matrix_bridge_mx_puppet_steam_systemd_wanted_services_list %} | |||||
| Wants={{ service }} | Wants={{ service }} | ||||
| {% endfor %} | {% endfor %} | ||||
| DefaultDependencies=no | DefaultDependencies=no | ||||
| @@ -22,18 +22,18 @@ 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_mx_puppet_steam_container_network }} \ | |||||
| --network={{ matrix_bridge_mx_puppet_steam_container_network }} \ | |||||
| -e CONFIG_PATH=/config/config.yaml \ | -e CONFIG_PATH=/config/config.yaml \ | ||||
| -e REGISTRATION_PATH=/config/registration.yaml \ | -e REGISTRATION_PATH=/config/registration.yaml \ | ||||
| --mount type=bind,src={{ matrix_mx_puppet_steam_config_path }},dst=/config \ | |||||
| --mount type=bind,src={{ matrix_mx_puppet_steam_data_path }},dst=/data \ | |||||
| {% for arg in matrix_mx_puppet_steam_container_extra_arguments %} | |||||
| --mount type=bind,src={{ matrix_bridge_mx_puppet_steam_config_path }},dst=/config \ | |||||
| --mount type=bind,src={{ matrix_bridge_mx_puppet_steam_data_path }},dst=/data \ | |||||
| {% for arg in matrix_bridge_mx_puppet_steam_container_extra_arguments %} | |||||
| {{ arg }} \ | {{ arg }} \ | ||||
| {% endfor %} | {% endfor %} | ||||
| {{ matrix_mx_puppet_steam_container_image }} | |||||
| {{ matrix_bridge_mx_puppet_steam_container_image }} | |||||
| {% if matrix_mx_puppet_steam_container_network != 'host' %} | |||||
| {% for network in matrix_mx_puppet_steam_container_additional_networks %} | |||||
| {% if matrix_bridge_mx_puppet_steam_container_network != 'host' %} | |||||
| {% for network in matrix_bridge_mx_puppet_steam_container_additional_networks %} | |||||
| ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mx-puppet-steam | ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mx-puppet-steam | ||||
| {% endfor %} | {% endfor %} | ||||
| {% endif %} | {% endif %} | ||||