Ansible: deliver validator-agent from the artreg registry instead of building on each host

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>
This commit is contained in:
ayurishchevandClaude Opus 5.5 committed 2026-11-02 23:59:33 +03:00
1 parent 65c6975a24
commit d0ab6b94f9
16 files changed
+323 -238

No files matched your search

@@ -1,5 +1,13 @@
---
# Образ уже собран: простой валидатора — только stop + rm + run.
# Образ уже скачан: простой валидатора — только stop + rm + run.
- name: Create the config directory
ansible.builtin.file:
path: "{{ remote_env_file | dirname }}"
state: directory
owner: root
group: root
mode: "0700"
- name: Copy the env file to the validator
ansible.builtin.copy:
src: "{{ local_env_file }}"
@@ -38,8 +46,9 @@
'--log-driver', 'json-file',
'--log-opt', 'max-size=' ~ log_max_size,
'--log-opt', 'max-file=' ~ log_max_file,
'--label', 'git.rev=' ~ rev_after.stdout,
'--label', 'image.tag=' ~ image_tag,
'--label', 'image.digest=' ~ resolved_digest,
'--label', 'deployed.by=ansible']
+ (capabilities | map('regex_replace', '^(.*)$', '--cap-add=\1') | list)
+ [image_ref] }}
+ [image_pull_ref] }}
register: started