aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/my_server/tasks/main.yml
blob: 277f2d1be7015d779c37072e519b8d84a5ee03c0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- name: 'Check if {{ server_dir }}/docker-compose.yml exists'
  become: true
  stat:
    path: '{{ server_dir }}/docker-compose.yml'
  register: server_exists

- when: server_exists.stat.exists
  name: Update containers
  become: true
  # community.docker.docker_compose is too confusing for me to use, sorry.
  shell: |
    docker-compose pull --quiet && \
        docker-compose build --pull && \
        docker-compose up -d
  args:
    chdir: '{{ server_dir }}'