From 867969a82372f27908eb7ac417fb9d1f1ef6b78d Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Mon, 4 May 2026 22:22:57 +0300 Subject: [PATCH] matrix-static-files: switch to modern community.docker docker_image modules Replaces `community.docker.docker_image` with the modern `docker_image_pull` module. Drops the `ansible_version` compatibility ladder and the now-redundant `_container_image_force_pull` variable (the new pull module handles registry refresh natively via `pull: always`). Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/5191. Co-Authored-By: Claude Opus 4.7 (1M context) --- roles/custom/matrix-static-files/defaults/main.yml | 1 - roles/custom/matrix-static-files/tasks/install.yml | 6 ++---- .../custom/matrix-static-files/tasks/validate_config.yml | 8 ++++++++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/roles/custom/matrix-static-files/defaults/main.yml b/roles/custom/matrix-static-files/defaults/main.yml index abc3e33dd..dad62ba53 100644 --- a/roles/custom/matrix-static-files/defaults/main.yml +++ b/roles/custom/matrix-static-files/defaults/main.yml @@ -35,7 +35,6 @@ matrix_static_files_container_image_registry_prefix: "{{ matrix_static_files_con matrix_static_files_container_image_registry_prefix_upstream: "{{ matrix_static_files_container_image_registry_prefix_upstream_default }}" matrix_static_files_container_image_registry_prefix_upstream_default: "docker.io/" matrix_static_files_container_image_tag: "{{ 'latest' if matrix_static_files_version == 'latest' else (matrix_static_files_version + '-alpine') }}" -matrix_static_files_container_image_force_pull: "{{ matrix_static_files_container_image.endswith(':latest') }}" matrix_static_files_container_network: "{{ matrix_static_files_identifier }}" diff --git a/roles/custom/matrix-static-files/tasks/install.yml b/roles/custom/matrix-static-files/tasks/install.yml index 3761497e7..203a83787 100644 --- a/roles/custom/matrix-static-files/tasks/install.yml +++ b/roles/custom/matrix-static-files/tasks/install.yml @@ -85,11 +85,9 @@ when: "not matrix_static_files_file_matrix_support_enabled | bool" - name: Ensure matrix-static-files container image is pulled - community.docker.docker_image: + community.docker.docker_image_pull: name: "{{ matrix_static_files_container_image }}" - source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" - force_source: "{{ matrix_static_files_container_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" - force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_static_files_container_image_force_pull }}" + pull: always register: matrix_static_files_container_image_pull_result retries: "{{ devture_playbook_help_container_retries_count }}" delay: "{{ devture_playbook_help_container_retries_delay }}" diff --git a/roles/custom/matrix-static-files/tasks/validate_config.yml b/roles/custom/matrix-static-files/tasks/validate_config.yml index 7924507f7..889fb1a31 100644 --- a/roles/custom/matrix-static-files/tasks/validate_config.yml +++ b/roles/custom/matrix-static-files/tasks/validate_config.yml @@ -20,3 +20,11 @@ - {'name': 'matrix_static_files_file_matrix_client_property_org_matrix_msc2965_authentication_issuer', when: "{{ matrix_static_files_file_matrix_client_property_org_matrix_msc2965_authentication_enabled and matrix_static_files_container_labels_base_domain_root_path_redirection_enabled }}"} - {'name': 'matrix_static_files_file_matrix_client_property_org_matrix_msc2965_authentication_account', when: "{{ matrix_static_files_file_matrix_client_property_org_matrix_msc2965_authentication_enabled and matrix_static_files_container_labels_base_domain_root_path_redirection_enabled }}"} + +- name: (Deprecation) Catch and report renamed matrix-static-files variables + ansible.builtin.fail: + msg: >- + The variable `{{ item.old }}` is deprecated. Please use `{{ item.new }}` instead. + when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0" + with_items: + - {'old': 'matrix_static_files_container_image_force_pull', 'new': ' (the new community.docker.docker_image_pull module handles this natively)'}