3
0
forked from jakub/ansible
This commit is contained in:
martin.fencl
2025-12-10 11:48:19 +01:00
parent 4f39d04e3f
commit bf35a6c253

View File

@@ -47,27 +47,27 @@
# 4) Start / update stack
immich_commands:
- >-
if [ ! -d '{{ immich_compose_dir }}' ]; then
echo 'ERROR: Directory {{ immich_compose_dir }} does not exist on VM; not touching anything.' >&2;
exit 1;
fi
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).';
if [ -f docker-compose.yml ]; then
cp docker-compose.yml "docker-compose.yml.bak-$(date +%F_%H-%M-%S)";
echo 'Existing docker-compose.yml backed up.';
fi;
mv docker-compose.yml.new docker-compose.yml;
else
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_
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).';
if [ -f docker-compose.yml ]; then
cp docker-compose.yml "docker-compose.yml.bak-$(date +%F_%H-%M-%S)";
echo 'Existing docker-compose.yml backed up.';
fi;
mv docker-compose.yml.new docker-compose.yml;
else
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"
tasks:
- name: Ensure sshpass is installed (for password-based SSH) # English comments
ansible.builtin.apt: