Files
computer-playbook/roles/web-app-joomla/tasks/04_debug.yml
kevinveenbirkenbachandClaude Opus 5 c750247e33 fix(joomla,yourls,penpot): exec on the node that holds the container
container exec is node-local: sys-svc-container/files/python/container.py dispatches docker exec with no swarm routing. These roles passed *_CONTAINER_ADDRESS, which names the service cluster-wide, and ran from the stack host, so a call landed on the manager and answered "No such container" whenever the task sat on a worker.

Each branch now resolves the hosting node and its node-local id once through sys-svc-compose/tasks/utils/swarm/resolve_host_cid.yml, the way web-app-baserow already does, and every exec uses *_LOCAL_CID with delegate_to on *_HOST_NODE. Compose is untouched: resolve_host_cid sets *_HOST_NODE to inventory_hostname there, so the delegation is to self and resolve_compose_cid passes the old address through.

penpot resolves only when native login is enabled, because the resolver waits up to 600x2s for convergence and both of its exec tasks are already gated on that flag.

The *_LOCAL_CID names come from a runtime set_fact, which the resolver lint cannot approve, so each scanned call site carries the nocheck the migrated mastodon sites already use. Measured with the lint parser itself: 19 exec lines carry a target, 19 would be flagged, 19 are suppressed. No nocheck reaches a rendered command or a task name, and the one comment that does land inside a bash body passes bash -n.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-04 13:47:35 +02:00

15 lines
579 B
YAML

---
- name: "🐛 Toggle Joomla debug flags safely (configuration.php)"
shell: >
container exec -i
-e J_CONFIG_FILE={{ JOOMLA_CONFIG_FILE | quote }}
-e J_MODE_DEBUG={{ MODE_DEBUG | bool | ternary('1','0') }}
-e J_ERR_LEVEL={{ MODE_DEBUG | bool | ternary('maximum','default') }}
{{ JOOMLA_LOCAL_CID | quote }} php --
args:
stdin: "{{ lookup('file', role_path ~ '/files/php/toggle_debug.php') }}"
register: j_cfg_debug
changed_when: (j_cfg_debug.stdout | trim) == "changed"
failed_when: j_cfg_debug.rc != 0
delegate_to: "{{ JOOMLA_HOST_NODE }}"