Explorar el Código

matrix-bot-go-neb: 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
3d0d5d4cd5
Se han modificado 3 ficheros con 10 adiciones y 5 borrados
  1. +0
    -1
      roles/custom/matrix-bot-go-neb/defaults/main.yml
  2. +2
    -4
      roles/custom/matrix-bot-go-neb/tasks/install.yml
  3. +8
    -0
      roles/custom/matrix-bot-go-neb/tasks/validate_config.yml

+ 0
- 1
roles/custom/matrix-bot-go-neb/defaults/main.yml Ver fichero

@@ -36,7 +36,6 @@ matrix_bot_go_neb_data_store_path: "{{ matrix_bot_go_neb_data_path }}/store"


matrix_bot_go_neb_container_image: "{{ matrix_bot_go_neb_container_image_registry_prefix }}matrixdotorg/go-neb:{{ matrix_bot_go_neb_container_image_tag }}" matrix_bot_go_neb_container_image: "{{ matrix_bot_go_neb_container_image_registry_prefix }}matrixdotorg/go-neb:{{ matrix_bot_go_neb_container_image_tag }}"
matrix_bot_go_neb_container_image_tag: "{{ matrix_bot_go_neb_version }}" matrix_bot_go_neb_container_image_tag: "{{ matrix_bot_go_neb_version }}"
matrix_bot_go_neb_container_image_force_pull: "{{ matrix_bot_go_neb_container_image.endswith(':latest') }}"
matrix_bot_go_neb_container_image_registry_prefix: "{{ matrix_bot_go_neb_container_image_registry_prefix_upstream }}" matrix_bot_go_neb_container_image_registry_prefix: "{{ matrix_bot_go_neb_container_image_registry_prefix_upstream }}"
matrix_bot_go_neb_container_image_registry_prefix_upstream: "{{ matrix_bot_go_neb_container_image_registry_prefix_upstream_default }}" matrix_bot_go_neb_container_image_registry_prefix_upstream: "{{ matrix_bot_go_neb_container_image_registry_prefix_upstream_default }}"
matrix_bot_go_neb_container_image_registry_prefix_upstream_default: "docker.io/" matrix_bot_go_neb_container_image_registry_prefix_upstream_default: "docker.io/"


+ 2
- 4
roles/custom/matrix-bot-go-neb/tasks/install.yml Ver fichero

@@ -45,11 +45,9 @@
register: matrix_bot_go_neb_support_files_result register: matrix_bot_go_neb_support_files_result


- name: Ensure go-neb container image is pulled - name: Ensure go-neb container image is pulled
community.docker.docker_image:
community.docker.docker_image_pull:
name: "{{ matrix_bot_go_neb_container_image }}" name: "{{ matrix_bot_go_neb_container_image }}"
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_bot_go_neb_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_bot_go_neb_container_image_force_pull }}"
pull: always
register: matrix_bot_go_neb_container_image_pull_result register: matrix_bot_go_neb_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-bot-go-neb/tasks/validate_config.yml Ver fichero

@@ -16,3 +16,11 @@
msg: >- msg: >-
You need at least 1 service in the matrix_bot_go_neb_services block. You need at least 1 service in the matrix_bot_go_neb_services block.
when: matrix_bot_go_neb_services is not defined or matrix_bot_go_neb_services[0] is not defined when: matrix_bot_go_neb_services is not defined or matrix_bot_go_neb_services[0] is not defined

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

Cargando…
Cancelar
Guardar