2023-09-25 23:40:09 +00:00
|
|
|
- name: Deploy app
|
|
|
|
hosts: cloud
|
|
|
|
gather_facts: false
|
|
|
|
vars:
|
2023-09-26 02:13:11 +00:00
|
|
|
app: immich
|
2023-09-25 23:40:09 +00:00
|
|
|
tasks:
|
|
|
|
- name: Wait for connection
|
|
|
|
ansible.builtin.wait_for_connection:
|
|
|
|
timeout: 300
|
2023-09-26 00:05:26 +00:00
|
|
|
- name: Get user
|
|
|
|
ansible.builtin.user:
|
|
|
|
name: debian
|
|
|
|
register: user
|
2023-09-26 02:13:11 +00:00
|
|
|
- name: Docker compose down
|
|
|
|
ansible.builtin.command: docker compose down
|
|
|
|
args:
|
|
|
|
chdir: "{{ user.home }}/{{ app }}"
|
2023-09-26 02:20:08 +00:00
|
|
|
ignore_errors: true
|
2023-09-25 23:40:09 +00:00
|
|
|
- name: Copy project
|
|
|
|
ansible.builtin.copy:
|
2023-09-26 02:13:11 +00:00
|
|
|
src: ./{{ app }}
|
2023-09-26 00:05:26 +00:00
|
|
|
dest: "{{ user.home }}"
|
2023-09-26 00:20:36 +00:00
|
|
|
mode: "0744"
|
2023-09-26 02:13:11 +00:00
|
|
|
- name: Docker compose up -d
|
|
|
|
ansible.builtin.command: docker compose up -d
|
2023-09-26 00:49:40 +00:00
|
|
|
args:
|
2023-09-26 02:13:11 +00:00
|
|
|
chdir: "{{ user.home }}/{{ app }}"
|