The role resolves image_tag to a digest once per run and pulls that image on every validator before replacing the container; the git and build steps are gone. scripts/publish-agent-image.sh builds and pushes the agent image (<rev12> and latest tags). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
980 B
YAML
29 lines
980 B
YAML
---
|
|
# Порядок важен: сначала всё, что не трогает работающий контейнер (проверки,
|
|
# скачивание образа), и только потом замена контейнера. Если что-то упало до
|
|
# replace, старый контейнер продолжает работать.
|
|
- name: Preflight checks
|
|
ansible.builtin.import_tasks: preflight.yml
|
|
tags: [preflight]
|
|
|
|
- name: Dry run stops after preflight
|
|
ansible.builtin.debug:
|
|
msg: "check mode: pull, replace and verify are skipped"
|
|
when: ansible_check_mode
|
|
tags: [always]
|
|
|
|
- name: Pull the image
|
|
ansible.builtin.import_tasks: pull.yml
|
|
when: not ansible_check_mode
|
|
tags: [pull]
|
|
|
|
- name: Replace the container
|
|
ansible.builtin.import_tasks: replace.yml
|
|
when: not ansible_check_mode
|
|
tags: [replace]
|
|
|
|
- name: Verify the new container
|
|
ansible.builtin.import_tasks: verify.yml
|
|
when: not ansible_check_mode
|
|
tags: [verify]
|