blob: d97da2e7d5548541393ed5e5c853413c6ef3ef70 [file] [log] [blame]
Zack Williamsb273a422016-05-18 13:33:00 -07001---
2# docker-compose-pull/tasks/main.yml
3
Zack Williams2e5d51a2016-05-18 16:45:22 -07004# Note: build/pull are mutually exclusive in this case
Zack Williamsb273a422016-05-18 13:33:00 -07005
6- name: Build images from dockerhub with docker-compose
7 command: ansible "{{ item.name }}" -b -u ubuntu -m command \
8 -a "docker-compose build chdir={{ item.path | expanduser }}"
9 with_items: "{{ docker_compose_list | selectattr('build') | list}}"
10
Zack Williams2e5d51a2016-05-18 16:45:22 -070011- name: Pull images from dockerhub with docker-compose
12 command: ansible "{{ item.name }}" -b -u ubuntu -m command \
13 -a "docker-compose pull chdir={{ item.path | expanduser }}"
14 with_items: "{{ docker_compose_list | rejectattr('build') | list}}"
15
Zack Williamsb273a422016-05-18 13:33:00 -070016- name: Run "docker-compose up" where required
17 command: ansible "{{ item.name }}" -b -u ubuntu -m command \
18 -a "docker-compose up -d chdir={{ item.path | expanduser }}"
19 with_items: "{{ docker_compose_list | selectattr('up') | list}}"
20