Run from the jump host: on each validator it updates the git clone in /opt/cloud-ip-validator, builds the image there, stops and removes the current container and starts a new one from the new image. Run parameters live in an env file (deploy/ansible/env/validator-agent.env, git-ignored, template committed). The image is built before the running container is touched, so a failed build leaves the old container running. Hosts are updated in waves (1, 4, rest) and any failure stops the run. validator_id comes from the inventory and is checked against the running container before it is replaced. Only ansible.builtin modules are used, so the validators need no extra packages. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
18 lines
887 B
YAML
18 lines
887 B
YAML
---
|
|
# Доставка validator-agent на все валидаторы: обновить git-клон, собрать образ
|
|
# на каждом хосте, остановить и удалить старый контейнер, поднять новый.
|
|
# Запуск (из deploy/ansible): ansible-playbook playbooks/deploy-validator-agent.yml
|
|
- name: Deliver validator-agent to the validators
|
|
hosts: validators
|
|
become: true
|
|
gather_facts: false
|
|
# Волны: один хост (канарейка), затем четыре, затем все остальные. Любой
|
|
# сбой останавливает прогон — следующая волна не начнётся.
|
|
# Все сразу: -e '{"deploy_serial": ["100%"]}'.
|
|
serial: "{{ deploy_serial }}"
|
|
max_fail_percentage: 0
|
|
vars:
|
|
deploy_serial: [1, 4, "100%"]
|
|
roles:
|
|
- validator_agent
|