diff --git a/roles/web-app-zammad/README.md b/roles/web-app-zammad/README.md index 47f1afbb78..1c0f8229a5 100644 --- a/roles/web-app-zammad/README.md +++ b/roles/web-app-zammad/README.md @@ -96,7 +96,7 @@ Solid `1:1` edges are fixed relationships; dashed `0..1` edges are conditional ( - **Mail-to-ticket:** When `web-app-stalwart` is present, the `helpdesk` mailbox is auto-provisioned and Zammad polls it to create tickets from incoming mail. - **Server-name alias:** `zammad.helpdesk.{{ DOMAIN_PRIMARY }}` is a true vhost alias of `helpdesk.{{ DOMAIN_PRIMARY }}` (not a 301 redirect). - **Bundled Elasticsearch:** Search engine ships with the role until a central `svc-db-elasticsearch` exists. -- **Search allocation precheck:** the one-shot `precheck` service runs [search_allocation_precheck.sh](files/shell/search_allocation_precheck.sh) and `init` starts only after it completed successfully. It creates a one-shard probe index and exits 0 once Elasticsearch allocates it; otherwise it exits 1 with the answer of `_cluster/allocation/explain`, which names the disk watermark when the data disk is too full, and `compose up` stops on it. +- **Search allocation precheck:** [search_allocation_precheck.sh](files/shell/search_allocation_precheck.sh) creates a one-shard probe index and fails with the answer of `_cluster/allocation/explain`, which names the disk watermark when the data disk is too full, unless Elasticsearch allocates it. The one-shot `precheck` service runs it and `init` depends on that service, so `compose up` stops on a refusal. `init` runs it again in front of `zammad-init`; in swarm, where `depends_on` does not gate `init`, the failing `init` tasks turn the stack fatal. - **Search index per Elasticsearch major:** The index lives in a directory named after the Elasticsearch major inside the `zammad_search` volume. A new major starts on an empty directory and `zammad-init` rebuilds the index from the database on the same deploy. - **Wizard bypass:** First deploy seeds `auto_wizard.json` so no manual setup UI step is required. diff --git a/roles/web-app-zammad/meta/volumes.yml b/roles/web-app-zammad/meta/volumes.yml index 45db2aab9b..9c76f0f22b 100644 --- a/roles/web-app-zammad/meta/volumes.yml +++ b/roles/web-app-zammad/meta/volumes.yml @@ -24,7 +24,9 @@ search_allocation_precheck: mode: "0555" mounts: - service: precheck - target: /usr/local/bin/search_allocation_precheck.sh + target: &usr_local_bin_search_allocation_precheck_sh_target /usr/local/bin/search_allocation_precheck.sh + - service: init + target: *usr_local_bin_search_allocation_precheck_sh_target auto_wizard: type: config source: "{{ [lookup('container', 'web-app-zammad', 'directories.volumes'), 'auto_wizard.json'] | path_join }}" diff --git a/roles/web-app-zammad/templates/compose.yml.j2 b/roles/web-app-zammad/templates/compose.yml.j2 index d4fe0db9eb..13dda09212 100644 --- a/roles/web-app-zammad/templates/compose.yml.j2 +++ b/roles/web-app-zammad/templates/compose.yml.j2 @@ -18,7 +18,7 @@ {{ lookup('container_image', application_id, 'zammad') }} {{ lookup('compose_only', 'container_name', ZAMMAD_INIT_CONTAINER) }} {% include 'roles/sys-svc-container/templates/base.yml.j2' %} - command: ["zammad-init"] + command: ["{{ ZAMMAD_SEARCH_PRECHECK_TARGET }}", "{{ ZAMMAD_SEARCH_READY_SECONDS }}", "{{ ZAMMAD_SEARCH_POLL_SECONDS }}", "{{ ZAMMAD_SEARCH_ALLOCATION_TIMEOUT_SECONDS }}", "/opt/zammad/bin/docker-entrypoint", "zammad-init"] {{ lookup('container_volumes', service_name) | indent(4) }} {{ lookup('container_depends_on', application_id, extra={ ZAMMAD_PRECHECK_SERVICE: {'condition': 'service_completed_successfully'},