Files
computer-playbook/roles/web-app-openproject/meta/volumes.yml
kevinveenbirkenbachandClaude Opus 5 750476b26a feat(lint): give every mount target one spot in meta/volumes.yml
A volume that reaches several services repeated its container path once per
mount. Written out each time it has no single point of truth: a rename that
misses one line still parses, still deploys, and mounts one service somewhere
nobody intended. Nothing fails until that service looks for content which is
not there.

YAML already solves this, and 62722a6ab used it here first -- web-app-openproject
anchors await_migrations_target and aliases it for the second service. Nineteen
roles now follow, and tests/lint/repository/spot/test_volumes_target_single_spot.py
fails on any target spelled out twice. An alias carries no path, so the rule
cannot see it, which is the point.

The conversion was mechanical and is provable rather than reviewed: every file
was rewritten and then reloaded, and any file whose yaml.safe_load result
differed from the original was discarded instead of kept. Nineteen written,
none discarded. Anchors and aliases are a serialisation form; the loader
resolves them before any consumer sees a document.

validate_volumes_meta over all 81 meta/volumes.yml reports no violation.
make test-lint: 328 passed.

web-app-prometheus carries two unrelated deletions: comments that predate this
change and fell under the comment lint once the file was touched. They explained
a 0444 mode and a compose-only bind; both facts are visible in the entries
themselves.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 02:02:29 +02:00

43 lines
1.4 KiB
YAML

---
data:
type: volume
name: openproject_data
mounts:
- service: proxy
target: &var_openproject_assets_target /var/openproject/assets
- service: web
target: *var_openproject_assets_target
- service: worker
target: *var_openproject_assets_target
- service: cron
target: *var_openproject_assets_target
- service: seeder
target: *var_openproject_assets_target
await_migrations:
type: config
source: "{{ [ lookup('container', 'web-app-openproject', 'directories.config'), 'await_migrations.sh'] | path_join }}"
mode: "0555"
mounts:
- service: web
target: &await_migrations_target /usr/local/bin/await_migrations.sh
- service: worker
target: *await_migrations_target
pgdata_dummy:
# Exception: mount only exists to prevent OpenProject images from creating
# anonymous volumes for the unused embedded postgres data path.
type: volume
name: openproject_pgdata_dummy
# nocheck: nfs-false-data-loss Reason: throwaway dummy, never read or written, re-provisioned on redeploy
nfs: false
mounts:
- service: proxy
target: &var_openproject_pgdata_target /var/openproject/pgdata
- service: web
target: *var_openproject_pgdata_target
- service: worker
target: *var_openproject_pgdata_target
- service: cron
target: *var_openproject_pgdata_target
- service: seeder
target: *var_openproject_pgdata_target