---

- name: create directory /etc/docker-compose/bandwidth_estimation_responder
  file:
    dest: /etc/docker-compose/bandwidth_estimation_responder
    state: directory
  become: yes

- name: templatize bandwidth_estimation_responder docker-compose.yml
  template:
    src=docker-compose.yml.j2
    dest=/etc/docker-compose/bandwidth_estimation_responder/docker-compose.yml
  become: yes

# Ansible 2.2 pull flag in docker_service still doesn't work as expected if
# any version of the image isn't present on the host
- command: docker-compose pull chdir=/etc/docker-compose/bandwidth_estimation_responder
  name: pull bandwidth_estimation_responder image

- name: run bandwidth_estimation_responder
  docker_compose:
    project_src: /etc/docker-compose/bandwidth_estimation_responder
    pull: yes
    restarted: "{{ bandwidth_estimation_responder_restart }}"
    state: "{{ bandwidth_estimation_responder_state }}"
