---
- name: "[{{ directory }}] Remove potentially existing service"
  docker_service:
    project_src: "{{ directory }}"
    state: absent

- name: "[{{ directory }}] Build service"
  docker_service:
    project_src: "{{ directory }}"
    build: yes
    state: absent

- name: "[{{ directory }}] Start service"
  docker_service:
    project_src: "{{ directory }}"
    state: present

---
- name: "[{{ directory }}] Build Docker images"
  # Workaround for https://github.com/ansible/ansible/issues/23607
  shell: docker-compose build
  args:
    chdir: "{{ directory }}"

- name: "[{{ directory }}] Remove potentially existing service"
  docker_service:
    project_src: "{{ directory }}"
    state: absent

- name: "[{{ directory }}] Build service"
  docker_service:
    project_src: "{{ directory }}"
    build: yes
    state: absent

- name: "[{{ directory }}] Start service"
  docker_service:
    project_src: "{{ directory }}"
    state: present

Add workaround for Ansible Docker Compose issue
Add workaround for Ansible Docker Compose issue
