Files
computer-playbook/playbook-sync.yml
T
kevinveenbirkenbachandClaude Opus 5.5 74bf74aa78 feat(design): sync one task file of a deployed role
A role sync runs the whole role, several hundred tasks, although a
design carrier usually lives in one task file. Iterating on that file
cost minutes per try.

`make compose-role-sync role=<app> variant=<idx> task=<file>` now runs
only that task file of the role against the running stack. The sync
playbook gets a third scope `task` next to `design` and `role`: it
places the shared services like a role sync, loads the token store and
the proxy handlers, includes the role with `tasks_from` and flushes
its handlers.

The task file gets the variables of the role and nothing an earlier
task of the role would have set, so it has to stand alone. The script
accepts a task path of plain path characters only, because the value
travels into a command line inside the container.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 09:00:22 +02:00

47 lines
2.0 KiB
YAML

---
- name: "Sync one deployed application against the running stack"
hosts: all
any_errors_fatal: true
become: true
environment:
CA_TRUST_CERT_HOST: "{{ CA_TRUST.cert_host }}"
CA_TRUST_WRAPPER_HOST: "{{ CA_TRUST.wrapper_host }}"
CA_TRUST_NAME: "{{ CA_TRUST.trust_name }}"
CA_TRUST_CERT_CONTAINER: "{{ CA_TRUST.inject_cert_container }}"
CA_TRUST_WRAPPER_CONTAINER: "{{ CA_TRUST.inject_wrapper_container }}"
CA_CONTAINER_ENABLED: "{{ CA_CONTAINER_ENABLED | int }}"
COMPOSE_HTTP_TIMEOUT: "600"
DOCKER_CLIENT_TIMEOUT: "600"
DOCKER_BUILDKIT: "{{ BUILDKIT_ENABLED | int }}"
COMPOSE_DOCKER_CLI_BUILD: "{{ BUILDKIT_ENABLED | int }}"
INFINITO_RESCUE_DIAGNOSTICS_DIR: "{{ DIR_RESCUE_DIAGNOSTICS }}"
CONTAINER_EXEC_TIMEOUT: "{{ SYS_TIMEOUT_CONTAINER_EXEC }}"
vars:
sync_application_id: "{{ APPLICATIONS_WHITELIST | first }}"
sync_scope: design
sync_task: ""
sync_playwright: false
tasks:
- name: ✅ Assert exactly one application and a known scope are targeted
ansible.builtin.assert:
that:
- APPLICATIONS_WHITELIST | length == 1
- sync_scope in ['design', 'role', 'task']
- sync_scope != 'task' or sync_task | length > 0
fail_msg: "Pass one application id in APPLICATIONS_WHITELIST and sync_scope=design|role|task (task needs sync_task), got {{ APPLICATIONS_WHITELIST }}, {{
sync_scope }} and '{{ sync_task }}'"
quiet: true
- name: 🔀 Merge variables
ansible.builtin.include_tasks: tasks/utils/constructor/variables.yml
- name: "📍 Place the shared services and the proxy on their hosts"
ansible.builtin.include_tasks: tasks/utils/constructor/placement.yml
when: sync_scope in ['role', 'task']
- name: 🧊 Render the applications SPOT once and carry it into every task's worker
applications_carrier: {}
- name: "🔁 Sync the {{ sync_scope }} of '{{ sync_application_id }}'"
ansible.builtin.include_tasks: "tasks/utils/sync/{{ sync_scope }}.yml"