kovalhome/infra/photos/0004_immich_compose_playboo...

31 lines
874 B
YAML

- name: Deploy app
hosts: photos
gather_facts: false
vars:
app: immich
tasks:
- name: Wait for connection
ansible.builtin.wait_for_connection:
timeout: 300
- name: Get user
ansible.builtin.user:
name: debian
register: user
- name: Docker compose down
ansible.builtin.command: docker compose down
args:
chdir: "{{ user.home }}/{{ app }}"
- name: Copy project
ansible.builtin.copy:
src: "./{{ app }}/docker-compose.yml"
dest: "{{ user.home }}/{{ app }}/docker-compose.yml"
mode: "0644"
- name: Docker compose pull
ansible.builtin.command: docker compose pull
args:
chdir: "{{ user.home }}/{{ app }}"
- name: Docker compose up -d
ansible.builtin.command: docker compose up -d
args:
chdir: "{{ user.home }}/{{ app }}"