From 4f39d04e3fd2773b9179c1730624e27627fda85f Mon Sep 17 00:00:00 2001 From: "martin.fencl" Date: Wed, 10 Dec 2025 11:12:03 +0100 Subject: [PATCH] edit --- update_immich.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/update_immich.yml b/update_immich.yml index c5a57f4..f72cf47 100644 --- a/update_immich.yml +++ b/update_immich.yml @@ -41,14 +41,18 @@ docker_prefix: "unalias docker 2>/dev/null || true; DOCKER_CLI_HINTS=0; command docker" # Commands to run on the target VM (quiet outputs) - # 1) Ensure compose dir exists + # 1) Check directory exists (we do NOT create anything, to stay safe) # 2) Safely download latest docker-compose.yml from GitHub (with backup) # 3) Pull images according to compose # 4) Start / update stack immich_commands: - - "mkdir -p {{ immich_compose_dir }}" - >- - cd {{ immich_compose_dir }} && + if [ ! -d '{{ immich_compose_dir }}' ]; then + echo 'ERROR: Directory {{ immich_compose_dir }} does not exist on VM; not touching anything.' >&2; + exit 1; + fi + - >- + cd '{{ immich_compose_dir }}' && wget -qO docker-compose.yml.new "{{ immich_compose_url }}" || true; if [ -s docker-compose.yml.new ]; then echo 'Downloaded new docker-compose.yml from GitHub (Immich latest).'; @@ -61,9 +65,9 @@ echo 'WARNING: Failed to download a valid docker-compose.yml, keeping existing one.' >&2; rm -f docker-compose.yml.new 2>/dev/null || true; fi - - "{{ docker_prefix }} compose -p {{ immich_project }} -f {{ immich_compose_file }} pull >/dev/null" - - "{{ docker_prefix }} compose -p {{ immich_project }} -f {{ immich_compose_file }} up -d --remove-orphans >/dev/null" + - "{{ docker_prefix }} compose -p_ + tasks: - name: Ensure sshpass is installed (for password-based SSH) # English comments ansible.builtin.apt: