Files
computer-playbook/roles/web-app-nextcloud/tasks/addons/onlyoffice.yml
kevinveenbirkenbachandClaude Opus 5.5 cce4373abd fix(web-app-nextcloud): bound the onlyoffice check by a wall-clock deadline
`retries: 30` with `delay: 10` only bounded the wait while each
`occ onlyoffice:documentserver --check` failed fast. onlyoffice v10.2.1
gives the health check and the version command 60 s each and the
conversion 120 s, so a document server that accepts connections but
does not answer held the deploy for up to two hours before it failed.

The retries now also stop once a deadline of
`lookup('timeout', 300)` seconds, set right before the check, has
passed. A per-attempt `timeout:` would not bound the total: ansible-core
2.21 leaves the `until` loop on the first timed-out attempt, so only a
limit below onlyoffice's 60 s would end a hanging server's loop.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-15 04:04:33 +02:00

16 lines
577 B
YAML

---
- name: "⏱️ Set the deadline for the document server check"
set_fact:
nextcloud_onlyoffice_check_deadline: "{{ now(utc=true).timestamp() + (lookup('timeout', 300) | int) }}"
- name: "🔎 Check the document server round trip and reset onlyoffice's settings_error"
shell: >
{{ NEXTCLOUD_DOCKER_EXEC_OCC }} onlyoffice:documentserver --check
register: nextcloud_onlyoffice_check
until: >-
nextcloud_onlyoffice_check.rc == 0
or now(utc=true).timestamp() > nextcloud_onlyoffice_check_deadline | float
retries: 30
delay: 10
changed_when: false