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

matrix-bridge-meshtastic-relay: 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
5b041201a4
3 измененных файлов: 10 добавлений и 5 удалений
  1. +0
    -1
      roles/custom/matrix-bridge-meshtastic-relay/defaults/main.yml
  2. +2
    -4
      roles/custom/matrix-bridge-meshtastic-relay/tasks/setup_install.yml
  3. +8
    -0
      roles/custom/matrix-bridge-meshtastic-relay/tasks/validate_config.yml

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

@@ -15,7 +15,6 @@ matrix_meshtastic_relay_container_image: "{{ matrix_meshtastic_relay_container_i
matrix_meshtastic_relay_container_image_registry_prefix: "{{ matrix_meshtastic_relay_container_image_registry_prefix_upstream }}"
matrix_meshtastic_relay_container_image_registry_prefix_upstream: "{{ matrix_meshtastic_relay_container_image_registry_prefix_upstream_default }}"
matrix_meshtastic_relay_container_image_registry_prefix_upstream_default: "ghcr.io/"
matrix_meshtastic_relay_container_image_force_pull: "{{ matrix_meshtastic_relay_container_image.endswith(':latest') }}"

matrix_meshtastic_relay_base_path: "{{ matrix_base_data_path }}/meshtastic-relay"



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

@@ -6,11 +6,9 @@
---

- name: Ensure matrix-meshtastic-relay image is pulled
community.docker.docker_image:
community.docker.docker_image_pull:
name: "{{ matrix_meshtastic_relay_container_image }}"
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_meshtastic_relay_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_meshtastic_relay_container_image_force_pull }}"
pull: always
register: matrix_meshtastic_relay_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"


+ 8
- 0
roles/custom/matrix-bridge-meshtastic-relay/tasks/validate_config.yml Просмотреть файл

@@ -21,3 +21,11 @@
`matrix_meshtastic_relay_connection_type` must be one of: `tcp`, `serial`, `ble`.
Got: `{{ matrix_meshtastic_relay_connection_type }}`.
when: "matrix_meshtastic_relay_connection_type not in ['tcp', 'serial', 'ble']"

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

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