Immich VM: Initial provision and decommission Immich from Cloud VM (#11)
All checks were successful
Infrastructure / Check and run Ansbile playbooks (push) Successful in 7m26s
All checks were successful
Infrastructure / Check and run Ansbile playbooks (push) Successful in 7m26s
Reviewed-on: #11
This commit is contained in:
37
infra/photos/0003_immich_playbook.yaml
Normal file
37
infra/photos/0003_immich_playbook.yaml
Normal file
@@ -0,0 +1,37 @@
|
||||
- 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 }}"
|
||||
ignore_errors: true
|
||||
- name: Copy project
|
||||
ansible.builtin.copy:
|
||||
src: "./{{ app }}"
|
||||
dest: "{{ user.home }}"
|
||||
mode: "0744"
|
||||
- name: Replace Typesense secret
|
||||
ansible.builtin.replace:
|
||||
path: "{{ user.home }}/{{ app }}/.env"
|
||||
regexp: "TYPESENSE_API_KEY_VALUE"
|
||||
replace: "{{ lookup('ansible.builtin.password', user.home + '/typesense_secret', length=64, chars=['ascii_letters', 'digits']) }}"
|
||||
- name: Replace DB secret
|
||||
ansible.builtin.replace:
|
||||
path: "{{ user.home }}/{{ app }}/.env"
|
||||
regexp: "DB_PASSWORD_VALUE"
|
||||
replace: "{{ lookup('ansible.builtin.password', user.home + '/db_secret', length=64, chars=['ascii_letters', 'digits']) }}"
|
||||
- name: Docker compose up -d
|
||||
ansible.builtin.command: docker compose up -d
|
||||
args:
|
||||
chdir: "{{ user.home }}/{{ app }}"
|
Reference in New Issue
Block a user