2024-01-27 17:41:57 +00:00
|
|
|
- name: Deploy app
|
|
|
|
hosts: samba
|
|
|
|
gather_facts: false
|
|
|
|
vars:
|
|
|
|
app: samba
|
|
|
|
tasks:
|
|
|
|
- name: Wait for connection
|
|
|
|
ansible.builtin.wait_for_connection:
|
|
|
|
timeout: 300
|
|
|
|
- name: Docker compose down
|
2024-01-30 12:37:37 +00:00
|
|
|
community.docker.docker_compose_v2:
|
|
|
|
project_src: "$HOME/{{ app }}"
|
|
|
|
state: absent
|
2024-01-27 17:41:57 +00:00
|
|
|
- name: Copy project
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: "./{{ app }}"
|
2024-01-30 12:37:37 +00:00
|
|
|
dest: "$HOME"
|
2024-01-27 17:41:57 +00:00
|
|
|
mode: "0744"
|
|
|
|
|
|
|
|
- name: Replace KVK Password secret
|
|
|
|
ansible.builtin.replace:
|
2024-01-30 12:37:37 +00:00
|
|
|
path: "$HOME/{{ app }}/config.yml"
|
2024-01-27 17:41:57 +00:00
|
|
|
regexp: "KVK_PASSWORD"
|
|
|
|
replace: "{{ lookup('infisical.vault.read_secrets', env_slug='prod', path='/samba', secret_name='KVK_PASSWORD')['value'] }}"
|
|
|
|
|
2024-01-30 12:37:37 +00:00
|
|
|
- name: Docker compose up
|
|
|
|
community.docker.docker_compose_v2:
|
|
|
|
project_src: "$HOME/{{ app }}"
|
2024-01-27 18:25:40 +00:00
|
|
|
|
|
|
|
- name: Update samba permissions
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: /mnt/share/samba
|
|
|
|
state: directory
|
|
|
|
recurse: true
|
|
|
|
owner: debian
|
|
|
|
group: debian
|
|
|
|
become: true
|