forked from jakub/ansible
edit
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
# Docker command prefix (consistent behavior and quiet hints)
|
# Docker command prefix (consistent behavior and quiet hints)
|
||||||
docker_prefix: "unalias docker 2>/dev/null || true; DOCKER_CLI_HINTS=0; command docker"
|
docker_prefix: "unalias docker 2>/dev/null || true; DOCKER_CLI_HINTS=0; command docker"
|
||||||
|
|
||||||
# Commands to run on the target VM (quiet outputs)
|
# Commands to run on the target VM (quiet outputs)
|
||||||
# 1) Download latest docker-compose.yml from GitHub (with backup)
|
# 1) Download latest docker-compose.yml from GitHub (with backup)
|
||||||
# 2) Pull images according to compose
|
# 2) Pull images according to compose
|
||||||
@@ -49,7 +49,6 @@
|
|||||||
- "{{ docker_prefix }} compose -p {{ immich_project }} -f {{ immich_compose_file }} pull >/dev/null"
|
- "{{ 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 {{ immich_project }} -f {{ immich_compose_file }} up -d --remove-orphans >/dev/null"
|
||||||
|
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Ensure sshpass is installed (for password-based SSH) # English comments
|
- name: Ensure sshpass is installed (for password-based SSH) # English comments
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
@@ -57,28 +56,6 @@
|
|||||||
state: present
|
state: present
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
|
||||||
|
|
||||||
- name: Immich | Check compose directory exists on VM
|
|
||||||
ansible.builtin.command:
|
|
||||||
argv:
|
|
||||||
- sshpass
|
|
||||||
- -e
|
|
||||||
- ssh
|
|
||||||
- -o
|
|
||||||
- StrictHostKeyChecking=no
|
|
||||||
- -o
|
|
||||||
- ConnectTimeout=15
|
|
||||||
- "{{ vm_user }}@{{ vm_ip }}"
|
|
||||||
- bash
|
|
||||||
- -lc
|
|
||||||
- "test -d {{ immich_compose_dir }}"
|
|
||||||
environment:
|
|
||||||
SSHPASS: "{{ vm_pass }}"
|
|
||||||
register: immich_dir
|
|
||||||
changed_when: false
|
|
||||||
failed_when: immich_dir.rc != 0
|
|
||||||
|
|
||||||
|
|
||||||
- name: Run Immich update commands on VM (via SSH) # use SSHPASS env, hide item value
|
- name: Run Immich update commands on VM (via SSH) # use SSHPASS env, hide item value
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
argv:
|
argv:
|
||||||
|
|||||||
Reference in New Issue
Block a user