aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/roles/my_server/tasks/main.yml
blob: 36cb4cc072c57978ecf088f4f998cf133a9d377c (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                             
              




                                               
                         
              

                                                                          


                                                      

                             
- 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 -q && \
        docker-compose build --force-rm --pull -q && \
        docker-compose up --remove-orphans -d
  args:
    chdir: '{{ server_dir }}'