4
0
mirror of https://github.com/spantaleev/matrix-docker-ansible-deploy.git synced 2026-05-19 04:18:06 +00:00

matrix-synapse: switch to modern community.docker docker_image modules

Replaces `community.docker.docker_image` with the modern
`docker_image_pull` and `docker_image_build` split modules across all
four task files (synapse, reverse_proxy_companion, goofys,
rust-synapse-compress-state). Drops the `ansible_version` compatibility
ladder and removes four `_container_image_force_pull` variables (the new
pull module handles registry refresh natively via `pull: always`).

The Synapse self-build path uses `ansible.builtin.shell` for BuildKit
support and is left as-is. The customizations image build (which builds
on top of the locally-tagged synapse image) is converted to
`docker_image_build` with `pull: false`, preserving its existing
rebuild-trigger semantics.

Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/5191.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Slavi Pantaleev
2026-05-04 22:25:44 +03:00
parent b91ce393e6
commit 152a3bbc2a
6 changed files with 20 additions and 27 deletions

View File

@@ -67,11 +67,9 @@
when: "matrix_synapse_git_pull_results.changed | bool or matrix_synapse_container_image_check_result.stdout == ''"
- name: Ensure Synapse Docker image is pulled
community.docker.docker_image:
community.docker.docker_image_pull:
name: "{{ matrix_synapse_container_image }}"
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_synapse_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_synapse_container_image_force_pull }}"
pull: always
when: "not matrix_synapse_container_image_self_build"
register: result
retries: "{{ devture_playbook_help_container_retries_count }}"
@@ -90,14 +88,14 @@
register: matrix_synapse_container_image_customizations_dockerfile_result
- name: Ensure customized Docker image for Synapse is built
community.docker.docker_image:
community.docker.docker_image_build:
name: "{{ matrix_synapse_container_image_customized }}"
source: build
force_source: "{{ matrix_synapse_container_image_customizations_dockerfile_result.changed or matrix_synapse_container_image_customized_force_source }}"
build:
dockerfile: Dockerfile
path: "{{ matrix_synapse_customized_container_src_files_path }}"
nocache: "{{ matrix_synapse_container_image_customized_build_nocache }}"
dockerfile: Dockerfile
path: "{{ matrix_synapse_customized_container_src_files_path }}"
pull: false
nocache: "{{ matrix_synapse_container_image_customized_build_nocache }}"
rebuild: "{{ 'always' if (matrix_synapse_container_image_customizations_dockerfile_result.changed | bool or matrix_synapse_container_image_customized_force_source | bool) else 'never' }}"
register: matrix_synapse_container_image_customized_build_result
# We do this so that the signing key would get generated.
#