task.yaml 704 Bytes
Newer Older
Aaron Yildiztas's avatar
Aaron Yildiztas committed
1
2
3
4
5
6
7
8

- name: Run using a project directory
  hosts: localhost
  gather_facts: no
  tasks:
    - name: Tear down existing services
      community.docker.docker_compose:
        project_src: flask
9
10
11
12
13
14
15
16
        state: absent

    - name: Create and start services
      community.docker.docker_compose:
        project_src: flask
      register: output

    - ansible.builtin.debug:
Aaron Yildiztas's avatar
Aaron Yildiztas committed
17
18
19
20
21
22
        var: output
    
    - name: Run `docker-compose up` again
      community.docker.docker_compose:
        project_src: flask
        build: no
Aaron Yildiztas's avatar
Aaron Yildiztas committed
23
24
25
26
27
28
29
      register: output

    - name: Stop all services
      community.docker.docker_compose:
        project_src: flask
        build: no
        stopped: yes
Aaron Yildiztas's avatar
Aaron Yildiztas committed
30
      register: output