Files
computer-playbook/roles/web-app-socialhome/tasks/main.yml
kevinveenbirkenbachandClaude Opus 5 a46348b6cf refactor(handlers): bind notify to a listen topic, not to a name
A handler name was doing two jobs at once: the line an operator reads in the
play output, and the identifier a `notify:` binds to. The two pull in opposite
directions -- the log wants "restart the SSH service, with diagnostics", the
binding wants a token that survives quoting, YAML flow style and a shell
round-trip -- and a name that changes for readability silently changes which
handler runs.

Every handler that a notify reached by name now carries a `listen:` with that
exact wording, so the binding is explicit before anything is renamed. The
topics themselves become identifiers: `compose up` reads `compose-up`,
`Restart NFS ganesha` reads `restart-nfs-ganesha`, 22 of them across both
sides of every notify. Where the topic is assembled at runtime, both branches
moved together: the conditional in sys-service carries two literals, and the
LDAP renderer interpolates `import-{{ folder }}-ldif-files`, which is what
makes those handlers reachable at all.

Freed from the binding, the names take the emoji prefix every other task line
already has.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-16 03:38:42 +02:00

22 lines
673 B
YAML

---
- name: "🧩 load docker, proxy for '{{ application_id }}'"
include_role:
name: sys-stk-full
vars:
compose_handlers_flush: false
- name: "📄 Render socialhome.toml for '{{ application_id }}'"
stack_host_template:
src: socialhome.toml.j2
dest: "{{ SOCIALHOME_CONFIG_HOST_FILE }}"
mode: "0444"
notify: compose-up
- name: "🐳 Finalize compose deploy for '{{ application_id }}'"
include_tasks: "{{ lookup('path_absolute', 'roles/sys-svc-compose/tasks/utils/finalize.yml') }}"
- name: "🔐 Complete the standalone first-boot setup for '{{ application_id }}'"
include_tasks: 01_setup.yml
run_once: true
when: IS_STACK_HOST | bool