25 lines
643 B
YAML
25 lines
643 B
YAML
|
- name: Deploy app
|
||
|
hosts: cloud
|
||
|
gather_facts: false
|
||
|
vars:
|
||
|
project_src: /home/debian/cloud
|
||
|
module_defaults:
|
||
|
community.docker.docker_compose:
|
||
|
project_src: "{{ project_src }}"
|
||
|
tasks:
|
||
|
- name: Wait for connection
|
||
|
ansible.builtin.wait_for_connection:
|
||
|
timeout: 300
|
||
|
- name: Copy project
|
||
|
ansible.builtin.copy:
|
||
|
directory_mode: true
|
||
|
src: ./cloud
|
||
|
mode: "0744"
|
||
|
dest: "{{ project_src }}"
|
||
|
- name: Docker compose down
|
||
|
community.docker.docker_compose:
|
||
|
state: absent
|
||
|
- name: Docker compose up
|
||
|
community.docker.docker_compose:
|
||
|
state: present
|