Files
computer-playbook/roles/sys-service-terminator/tasks/01_run_one.yml
kevinveenbirkenbachandClaude Fable 5 c51c0de9ba refactor(diagnostics): recursive workflow-level rescue snapshot, no in-play rescue blocks
Replace scripts/system/diagnostics/rescue.sh with utils/diagnostics/
container.py: one workflow call on failure captures the current level
(containers with logs+inspect, swarm services, journal, host resources,
in-play role dumps) and recurses itself through every DiD boundary via
self-copy, from the runner down to the innermost runtime (RESCUE_MAX_DEPTH).
compose and swarm now share an identical failure step; the swarm per-node
collector wrapper is gone. All 17 script-only Ansible rescue: blocks are
deleted and their bare block: wrappers inlined (plus a wordpress leftover);
the three justified blocks (postgres pg_hba, xwiki extensions, keycloak
cross-node recovery) keep their evidence tasks and now end in a fail task.
Two lints enforce the state: rescue: is forbidden without a
'# nocheck: rescue-<reason>' first-task marker, and a block without
rescue/always/when or another scoping key must be inlined.
sys-service-terminator hoists become to the include apply. Also move
routine/08_cleanup.sh to utils/clean/teardown.sh and topology/ to
utils/topology/ so routine/ holds only the sequenced flow.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 03:15:53 +02:00

20 lines
698 B
YAML

---
- name: "🔎 Check {{ system_service_run_unit }} is installed on this host"
ansible.builtin.command: "systemctl cat {{ system_service_run_unit }}"
register: system_service_run_unit_present
changed_when: false
failed_when: false
when: DEPLOYMENT_MODE == 'swarm'
- name: "🔄 Apply state (retry up to {{ SYS_SERVICE_RUNNER_RETRIES }} times)"
ansible.builtin.systemd:
name: "{{ system_service_run_unit }}"
state: "{{ SYS_SERVICE_RUNNER_STATE }}"
register: result
retries: "{{ SYS_SERVICE_RUNNER_RETRIES }}"
delay: "{{ SYS_SERVICE_RUNNER_DELAY }}"
until: result is not failed
when: >-
DEPLOYMENT_MODE == 'compose'
or system_service_run_unit_present.rc == 0