blob: 30a7d387b4fde3d63308c0e8b9ca3303f8eb4702 [file] [log] [blame]
---
# docker-compose-pull/tasks/main.yml
- name: Pull images from dockerhub with docker-compose
command: ansible "{{ item.name }}" -b -u ubuntu -m command \
-a "docker-compose pull chdir={{ item.path | expanduser }}"
with_items: "{{ docker_compose_list | selectattr('pull') | list}}"
- name: Build images from dockerhub with docker-compose
command: ansible "{{ item.name }}" -b -u ubuntu -m command \
-a "docker-compose build chdir={{ item.path | expanduser }}"
with_items: "{{ docker_compose_list | selectattr('build') | list}}"
- name: Run "docker-compose up" where required
command: ansible "{{ item.name }}" -b -u ubuntu -m command \
-a "docker-compose up -d chdir={{ item.path | expanduser }}"
with_items: "{{ docker_compose_list | selectattr('up') | list}}"