5
0
mirror of https://github.com/spantaleev/matrix-docker-ansible-deploy.git synced 2026-07-17 15:26:41 +00:00

Rename matrix_steam_bridge_* variables to matrix_bridge_steam_*

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:01:21 +03:00
parent a77b8f6eab
commit 129f5fda20
10 changed files with 309 additions and 309 deletions
@@ -10,15 +10,15 @@
- install-all
- install-matrix-steam-bridge
block:
- when: matrix_steam_bridge_enabled | bool
- when: matrix_bridge_steam_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
- when: matrix_steam_bridge_enabled | bool
- when: matrix_bridge_steam_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
- tags:
- setup-all
- setup-matrix-steam-bridge
block:
- when: not matrix_steam_bridge_enabled | bool
- when: not matrix_bridge_steam_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
@@ -5,17 +5,17 @@
---
- ansible.builtin.set_fact:
matrix_steam_bridge_migration_requires_restart: false
matrix_bridge_steam_migration_requires_restart: false
- name: Ensure Steam bridge image is pulled
community.docker.docker_image_pull:
name: "{{ matrix_steam_bridge_container_image }}"
name: "{{ matrix_bridge_steam_container_image }}"
pull: always
when: matrix_steam_bridge_enabled | bool and not matrix_steam_bridge_container_image_self_build
register: matrix_steam_bridge_container_image_pull_result
when: matrix_bridge_steam_enabled | bool and not matrix_bridge_steam_container_image_self_build
register: matrix_bridge_steam_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: matrix_steam_bridge_container_image_pull_result is not failed
until: matrix_bridge_steam_container_image_pull_result is not failed
- name: Ensure Steam bridge paths exist
ansible.builtin.file:
@@ -25,67 +25,67 @@
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
with_items:
- {path: "{{ matrix_steam_bridge_base_path }}", when: true}
- {path: "{{ matrix_steam_bridge_config_path }}", when: true}
- {path: "{{ matrix_steam_bridge_data_path }}", when: true}
- {path: "{{ matrix_steam_bridge_container_src_files_path }}", when: "{{ matrix_steam_bridge_container_image_self_build }}"}
- {path: "{{ matrix_bridge_steam_base_path }}", when: true}
- {path: "{{ matrix_bridge_steam_config_path }}", when: true}
- {path: "{{ matrix_bridge_steam_data_path }}", when: true}
- {path: "{{ matrix_bridge_steam_container_src_files_path }}", when: "{{ matrix_bridge_steam_container_image_self_build }}"}
when: item.when | bool
- name: Ensure Steam bridge repository is present on self-build
ansible.builtin.git:
repo: "{{ matrix_steam_bridge_container_image_self_build_repo }}"
version: "{{ matrix_steam_bridge_container_image_self_build_repo_version }}"
dest: "{{ matrix_steam_bridge_container_src_files_path }}"
repo: "{{ matrix_bridge_steam_container_image_self_build_repo }}"
version: "{{ matrix_bridge_steam_container_image_self_build_repo_version }}"
dest: "{{ matrix_bridge_steam_container_src_files_path }}"
force: "yes"
become: true
become_user: "{{ matrix_user_name }}"
register: matrix_steam_bridge_git_pull_results
when: "matrix_steam_bridge_enabled | bool and matrix_steam_bridge_container_image_self_build"
register: matrix_bridge_steam_git_pull_results
when: "matrix_bridge_steam_enabled | bool and matrix_bridge_steam_container_image_self_build"
- name: Ensure Steam bridge Docker image is built
community.docker.docker_image_build:
name: "{{ matrix_steam_bridge_container_image }}"
name: "{{ matrix_bridge_steam_container_image }}"
dockerfile: Dockerfile
path: "{{ matrix_steam_bridge_container_src_files_path }}"
path: "{{ matrix_bridge_steam_container_src_files_path }}"
pull: true
rebuild: "{{ 'always' if matrix_steam_bridge_git_pull_results.changed | bool else 'never' }}"
when: "matrix_steam_bridge_enabled | bool and matrix_steam_bridge_container_image_self_build | bool"
register: matrix_steam_bridge_container_image_build_result
rebuild: "{{ 'always' if matrix_bridge_steam_git_pull_results.changed | bool else 'never' }}"
when: "matrix_bridge_steam_enabled | bool and matrix_bridge_steam_container_image_self_build | bool"
register: matrix_bridge_steam_container_image_build_result
- name: Ensure matrix-steam-bridge config.yaml installed
ansible.builtin.copy:
content: "{{ matrix_steam_bridge_configuration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_steam_bridge_config_path }}/config.yaml"
content: "{{ matrix_bridge_steam_configuration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_bridge_steam_config_path }}/config.yaml"
mode: '0644'
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_steam_bridge_config_result
register: matrix_bridge_steam_config_result
- name: Ensure matrix-steam-bridge registration.yaml installed
ansible.builtin.copy:
content: "{{ matrix_steam_bridge_registration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_steam_bridge_config_path }}/registration.yaml"
content: "{{ matrix_bridge_steam_registration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_bridge_steam_config_path }}/registration.yaml"
mode: '0644'
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_steam_bridge_registration_result
register: matrix_bridge_steam_registration_result
- name: Ensure matrix-steam-bridge support files installed
ansible.builtin.template:
src: "{{ role_path }}/templates/{{ item }}.j2"
dest: "{{ matrix_steam_bridge_base_path }}/{{ item }}"
dest: "{{ matrix_bridge_steam_base_path }}/{{ item }}"
mode: '0640'
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
with_items:
- labels
register: matrix_steam_bridge_support_files_result
register: matrix_bridge_steam_support_files_result
- name: Ensure matrix-steam-bridge container network is created
when: matrix_steam_bridge_container_network != 'host'
when: matrix_bridge_steam_container_network != 'host'
community.general.docker_network:
enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
name: "{{ matrix_steam_bridge_container_network }}"
name: "{{ matrix_bridge_steam_container_network }}"
driver: bridge
driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
@@ -94,19 +94,19 @@
src: "{{ role_path }}/templates/systemd/matrix-steam-bridge.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-steam-bridge.service"
mode: '0644'
register: matrix_steam_bridge_systemd_service_result
register: matrix_bridge_steam_systemd_service_result
- name: Determine whether matrix-steam-bridge needs a restart
ansible.builtin.set_fact:
matrix_steam_bridge_restart_necessary: >-
matrix_bridge_steam_restart_necessary: >-
{{
matrix_steam_bridge_migration_requires_restart | default(false)
or matrix_steam_bridge_config_result.changed | default(false)
or matrix_steam_bridge_registration_result.changed | default(false)
or matrix_steam_bridge_support_files_result.changed | default(false)
or matrix_steam_bridge_systemd_service_result.changed | default(false)
or matrix_steam_bridge_container_image_pull_result.changed | default(false)
or matrix_steam_bridge_container_image_build_result.changed | default(false)
matrix_bridge_steam_migration_requires_restart | default(false)
or matrix_bridge_steam_config_result.changed | default(false)
or matrix_bridge_steam_registration_result.changed | default(false)
or matrix_bridge_steam_support_files_result.changed | default(false)
or matrix_bridge_steam_systemd_service_result.changed | default(false)
or matrix_bridge_steam_container_image_pull_result.changed | default(false)
or matrix_bridge_steam_container_image_build_result.changed | default(false)
}}
- name: Ensure matrix-steam-bridge.service restarted, if necessary
@@ -114,4 +114,4 @@
name: "matrix-steam-bridge.service"
state: restarted
daemon_reload: true
when: "matrix_steam_bridge_migration_requires_restart | bool"
when: "matrix_bridge_steam_migration_requires_restart | bool"
@@ -7,9 +7,9 @@
- name: Check existence of matrix-steam-bridge service
ansible.builtin.stat:
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-steam-bridge.service"
register: matrix_steam_bridge_service_stat
register: matrix_bridge_steam_service_stat
- when: matrix_steam_bridge_service_stat.stat.exists | bool
- when: matrix_bridge_steam_service_stat.stat.exists | bool
block:
- name: Ensure matrix-steam-bridge is stopped
ansible.builtin.service:
@@ -11,15 +11,15 @@
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"
with_items:
- {'old': 'matrix_steam_bridge_docker_image_name_prefix', 'new': 'matrix_steam_bridge_container_image_registry_prefix'}
- {'old': 'matrix_steam_bridge_docker_image', 'new': 'matrix_steam_bridge_container_image'}
- {'old': 'matrix_steam_bridge_docker_image_force_pull', 'new': 'matrix_steam_bridge_container_image_force_pull'}
- {'old': 'matrix_steam_bridge_docker_image_registry_prefix', 'new': 'matrix_steam_bridge_container_image_registry_prefix'}
- {'old': 'matrix_steam_bridge_docker_image_registry_prefix_upstream', 'new': 'matrix_steam_bridge_container_image_registry_prefix_upstream'}
- {'old': 'matrix_steam_bridge_docker_image_registry_prefix_upstream_default', 'new': 'matrix_steam_bridge_container_image_registry_prefix_upstream_default'}
- {'old': 'matrix_steam_bridge_docker_image_tag', 'new': 'matrix_steam_bridge_container_image_tag'}
- {'old': 'matrix_steam_bridge_docker_src_files_path', 'new': 'matrix_steam_bridge_container_src_files_path'}
- {'old': 'matrix_steam_bridge_container_image_force_pull', 'new': '<removed> (the new community.docker.docker_image_pull module handles this natively)'}
- {'old': 'matrix_bridge_steam_docker_image_name_prefix', 'new': 'matrix_bridge_steam_container_image_registry_prefix'}
- {'old': 'matrix_bridge_steam_docker_image', 'new': 'matrix_bridge_steam_container_image'}
- {'old': 'matrix_bridge_steam_docker_image_force_pull', 'new': 'matrix_bridge_steam_container_image_force_pull'}
- {'old': 'matrix_bridge_steam_docker_image_registry_prefix', 'new': 'matrix_bridge_steam_container_image_registry_prefix'}
- {'old': 'matrix_bridge_steam_docker_image_registry_prefix_upstream', 'new': 'matrix_bridge_steam_container_image_registry_prefix_upstream'}
- {'old': 'matrix_bridge_steam_docker_image_registry_prefix_upstream_default', 'new': 'matrix_bridge_steam_container_image_registry_prefix_upstream_default'}
- {'old': 'matrix_bridge_steam_docker_image_tag', 'new': 'matrix_bridge_steam_container_image_tag'}
- {'old': 'matrix_bridge_steam_docker_src_files_path', 'new': 'matrix_bridge_steam_container_src_files_path'}
- {'old': 'matrix_bridge_steam_container_image_force_pull', 'new': '<removed> (the new community.docker.docker_image_pull module handles this natively)'}
- name: Fail if required matrix_steam_bridge settings not defined
ansible.builtin.fail:
@@ -27,11 +27,11 @@
You need to define a required configuration setting (`{{ item.name }}`).
when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0"
with_items:
- {'name': 'matrix_steam_bridge_appservice_token', when: true}
- {'name': 'matrix_steam_bridge_homeserver_address', when: true}
- {'name': 'matrix_steam_bridge_homeserver_token', when: true}
- {'name': 'matrix_steam_bridge_database_hostname', when: "{{ matrix_steam_bridge_database_engine == 'postgres' }}"}
- {'name': 'matrix_steam_bridge_container_network', when: true}
- {'name': 'matrix_steam_bridge_metrics_proxying_hostname', when: "{{ matrix_steam_bridge_metrics_proxying_enabled }}"}
- {'name': 'matrix_steam_bridge_metrics_proxying_path_prefix', when: "{{ matrix_steam_bridge_metrics_proxying_enabled }}"}
- {'name': 'matrix_bridge_steam_appservice_token', when: true}
- {'name': 'matrix_bridge_steam_homeserver_address', when: true}
- {'name': 'matrix_bridge_steam_homeserver_token', when: true}
- {'name': 'matrix_bridge_steam_database_hostname', when: "{{ matrix_bridge_steam_database_engine == 'postgres' }}"}
- {'name': 'matrix_bridge_steam_container_network', when: true}
- {'name': 'matrix_bridge_steam_metrics_proxying_hostname', when: "{{ matrix_bridge_steam_metrics_proxying_enabled }}"}
- {'name': 'matrix_bridge_steam_metrics_proxying_path_prefix', when: "{{ matrix_bridge_steam_metrics_proxying_enabled }}"}
# TODO: Confirm additional config isn't mandatory for public_media