mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-30 14:56:11 +00:00
fix(openresty): dump the debug logs from a manager
The MODE_DEBUG block of the restart handler carries no host gate, unlike its two siblings in the same file which are pinned to a deployment mode and, in swarm, to IS_STACK_HOST. A handler runs on the host that notified it, and a worker reaches this notify: sys-stk-front-proxy/tasks/main.yml:112-118 is an always-changed `command: true` whose only guard is `not nginx_conf.changed`, and the stack-host template action forces changed:False on workers, so the guard is always satisfied there. On a worker the container_address subshell then exits 64 - resolve-container-id refuses to run off a manager - the substitution collapses to empty, `container logs --tail=200` fails, and failed_when:false plus ignore_errors:true swallow it. The debug task below prints an empty string, so the diagnostic reports "no logs" on exactly the node someone enabled MODE_DEBUG to inspect. container_address returns a string to embed, not a delegation; it decides what is addressed, not from where. delegate_to supplies the second half. STACK_HOST rather than the resolve_host_cid include, because svc-prx-openresty declares placement: manager (meta/services.yml:9), so the task can only run on a manager and the full host resolution buys nothing. In compose STACK_HOST is inventory_hostname, so this is a no-op there. The sibling `container ps -a` stays undelegated: a per-node container listing is legitimately node-local. Diagnostics only - nothing gates on openresty_logs, and MODE_DEBUG defaults to false. Not executed: no swarm worker run reproduces the empty dump. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
ee12b412e0
commit
bbb35c7bce
1 file changed
+1
@@ -62,6 +62,7 @@
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
ignore_errors: true
|
||||
delegate_to: "{{ STACK_HOST }}"
|
||||
|
||||
- ansible.builtin.debug:
|
||||
msg: |
|
||||
|
||||
Reference in new issue
Block a user