Explorar el Código

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) <noreply@anthropic.com>
pull/4219/merge
Slavi Pantaleev hace 2 días
padre
commit
867969a823
Se han modificado 3 ficheros con 10 adiciones y 5 borrados
  1. +0
    -1
      roles/custom/matrix-static-files/defaults/main.yml
  2. +2
    -4
      roles/custom/matrix-static-files/tasks/install.yml
  3. +8
    -0
      roles/custom/matrix-static-files/tasks/validate_config.yml

+ 0
- 1
roles/custom/matrix-static-files/defaults/main.yml Ver fichero

@@ -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: "{{ 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_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_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 }}" matrix_static_files_container_network: "{{ matrix_static_files_identifier }}"




+ 2
- 4
roles/custom/matrix-static-files/tasks/install.yml Ver fichero

@@ -85,11 +85,9 @@
when: "not matrix_static_files_file_matrix_support_enabled | bool" when: "not matrix_static_files_file_matrix_support_enabled | bool"


- name: Ensure matrix-static-files container image is pulled - name: Ensure matrix-static-files container image is pulled
community.docker.docker_image:
community.docker.docker_image_pull:
name: "{{ matrix_static_files_container_image }}" 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 register: matrix_static_files_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 }}"


+ 8
- 0
roles/custom/matrix-static-files/tasks/validate_config.yml Ver fichero

@@ -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_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': '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': '<removed> (the new community.docker.docker_image_pull module handles this natively)'}

Cargando…
Cancelar
Guardar