Просмотр исходного кода

matrix-client-commet: 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 1 день назад
Родитель
Сommit
0d6fc9b766
4 измененных файлов: 17 добавлений и 5 удалений
  1. +0
    -1
      roles/custom/matrix-client-commet/defaults/main.yml
  2. +3
    -0
      roles/custom/matrix-client-commet/tasks/main.yml
  3. +2
    -4
      roles/custom/matrix-client-commet/tasks/setup_install.yml
  4. +12
    -0
      roles/custom/matrix-client-commet/tasks/validate_config.yml

+ 0
- 1
roles/custom/matrix-client-commet/defaults/main.yml Просмотреть файл

@@ -30,7 +30,6 @@ matrix_client_commet_container_image_self_build_repo: "https://github.com/commet
matrix_client_commet_container_image_self_build_git_hash: ""
matrix_client_commet_container_image_self_build_version_tag: "{{ matrix_client_commet_version }}"
matrix_client_commet_container_image: "localhost/matrix-client-commet:{{ matrix_client_commet_version }}"
matrix_client_commet_container_image_force_pull: "{{ matrix_client_commet_container_image.endswith(':latest') or matrix_client_commet_container_image.endswith(':main') }}"

# The in-container port nginx listens on
matrix_client_commet_container_port: 8080


+ 3
- 0
roles/custom/matrix-client-commet/tasks/main.yml Просмотреть файл

@@ -10,6 +10,9 @@
- install-all
- install-client-commet
block:
- when: matrix_client_commet_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"

- when: matrix_client_commet_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"



+ 2
- 4
roles/custom/matrix-client-commet/tasks/setup_install.yml Просмотреть файл

@@ -17,11 +17,9 @@
- "{{ matrix_client_commet_config_path }}"

- name: Ensure Commet container image is pulled
community.docker.docker_image:
community.docker.docker_image_pull:
name: "{{ matrix_client_commet_container_image }}"
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_client_commet_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_client_commet_container_image_force_pull }}"
pull: always
when: "not matrix_client_commet_container_image_self_build | bool"
register: matrix_client_commet_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"


+ 12
- 0
roles/custom/matrix-client-commet/tasks/validate_config.yml Просмотреть файл

@@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: 2026 MDAD project contributors
#
# SPDX-License-Identifier: AGPL-3.0-or-later

---
- name: (Deprecation) Catch and report renamed matrix-client-commet 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_client_commet_container_image_force_pull', 'new': '<removed> (the new community.docker.docker_image_pull module handles this natively)'}

Загрузка…
Отмена
Сохранить