Files
computer-playbook/roles/sys-svc-container/defaults/main.yml
kevinveenbirkenbachandClaude Opus 4.7 d194c1fa26 feat(sys-svc-container): SPOT compose_replicas lookup + replica-handler lint
Add the compose_replicas lookup plugin as the single source of truth for
swarm replica calculation. Default emits `replicas: len(groups[application_id])`
(topology-driven); override term forces an explicit value. In compose mode
the lookup returns the empty string because docker-compose ignores
deploy.replicas.

Refactor deploy.yml.j2 to use the lookup. The previous service_replicas
default in defaults/main.yml is no longer needed and is dropped.

Add a lint test that walks every roles/*/templates/compose*.yml.j2 and
verifies each service entry under the top-level services: declares
replica handling via one of three valid paths:

  1. Include sys-svc-container/templates/base.yml.j2 (full inheritance).
  2. Include sys-svc-container/templates/deploy.yml.j2 directly (escape
     hatch for services that own their restart/logging/env_file and
     therefore can't use base.yml.j2 without duplicate-key conflicts).
  3. Call lookup('compose_replicas', ...) explicitly for handcrafted
     deploy: blocks.

Fix the 7 web-app compose templates flagged by the new lint (bluesky,
dashboard, magento, matrix, moodle, nextcloud, opentalk) by including
deploy.yml.j2 directly and setting service_name as a SPOT before each
service entry, so the service name in the yaml key and the resource_filter
lookups in deploy.yml.j2 both flow from one variable.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-05 18:19:03 +02:00

4 lines
62 B
YAML

---
service_update_parallelism: 1
service_update_delay: "10s"