forked from jakub/ansible
.
This commit is contained in:
@@ -74,27 +74,19 @@
|
|||||||
|
|
||||||
- |
|
- |
|
||||||
cd {{ immich_dir }}
|
cd {{ immich_dir }}
|
||||||
# Create override file if missing (keep local mounts here so upstream compose can be replaced safely)
|
# Ensure override compose exists (create if missing)
|
||||||
python3 - <<'PY'
|
if [ ! -f "{{ immich_override_file }}" ]; then
|
||||||
# Create docker-compose.override.yml only if missing
|
printf '%s\n' \
|
||||||
from pathlib import Path
|
'services:' \
|
||||||
import textwrap
|
' immich-server:' \
|
||||||
|
' volumes:' \
|
||||||
|
' - /mnt/nextcloud-howard-photos:/mnt/nextcloud-howard-photos' \
|
||||||
|
' - /mnt/nextcloud-kamilkaprdelka-photos:/mnt/nextcloud-kamilkaprdelka-photos' \
|
||||||
|
> "{{ immich_override_file }}"
|
||||||
|
fi
|
||||||
|
# Fail early if override is still missing/empty
|
||||||
|
test -s "{{ immich_override_file }}"
|
||||||
|
|
||||||
p = Path("docker-compose.override.yml")
|
|
||||||
if p.exists():
|
|
||||||
raise SystemExit(0)
|
|
||||||
|
|
||||||
content = textwrap.dedent("""\
|
|
||||||
# Local overrides for Immich (kept separate from upstream docker-compose.yml).
|
|
||||||
# If you want read-only mounts, append ':ro' to the right side.
|
|
||||||
services:
|
|
||||||
immich-server:
|
|
||||||
volumes:
|
|
||||||
- /mnt/nextcloud-howard-photos:/mnt/nextcloud-howard-photos
|
|
||||||
- /mnt/nextcloud-kamilkaprdelka-photos:/mnt/nextcloud-kamilkaprdelka-photos
|
|
||||||
""")
|
|
||||||
p.write_text(content, encoding="utf-8")
|
|
||||||
PY
|
|
||||||
|
|
||||||
- |
|
- |
|
||||||
cd {{ immich_dir }}
|
cd {{ immich_dir }}
|
||||||
|
|||||||
Reference in New Issue
Block a user