mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
fix(svc-prx-openresty): swarm-aware handler — exec reload + container_address
Replace bare-name docker restart with container_address-resolved openresty -s reload so the handler works on swarm tasks (named <stack>_<svc>.<n>.<id>) without dropping listeners on 80/443. Apply the same container_address fix to the MODE_DEBUG logs collection. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
1 parent
b2c8050718
commit
a9ca2ae688
1 file changed
+6
-5
@@ -10,9 +10,10 @@
|
||||
('no such container' not in ((openresty_test_pre.stderr | default('')) | lower)) and
|
||||
('is restarting' not in ((openresty_test_pre.stderr | default('')) | lower))
|
||||
|
||||
- name: Restart OpenResty container
|
||||
ansible.builtin.command: >
|
||||
container restart {{ OPENRESTY_CONTAINER }}
|
||||
- name: Reload OpenResty configuration (in-place, preserves listeners)
|
||||
ansible.builtin.shell: >
|
||||
container exec {{ lookup('container_address', 'svc-prx-openresty', 'openresty') }}
|
||||
openresty -s reload
|
||||
register: openresty_restart
|
||||
changed_when: true
|
||||
failed_when: >
|
||||
@@ -32,8 +33,8 @@
|
||||
failed_when: false
|
||||
ignore_errors: true
|
||||
|
||||
- ansible.builtin.command: >
|
||||
container logs --tail=200 {{ OPENRESTY_CONTAINER }}
|
||||
- ansible.builtin.shell: >
|
||||
container logs --tail=200 {{ lookup('container_address', 'svc-prx-openresty', 'openresty') }}
|
||||
register: openresty_logs
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
Reference in new issue
Block a user