mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
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>
20 lines
698 B
YAML
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
|