|
|
|
---
|
|
|
|
|
|
|
|
- name: Create main folder for configuration files
|
|
|
|
file:
|
|
|
|
path: "{{ wh_docker_root_dir }}/conf"
|
|
|
|
state: directory
|
|
|
|
owner: bin
|
|
|
|
group: wheel
|
|
|
|
mode: '0644'
|
|
|
|
|
|
|
|
- name: Create folders for each containers
|
|
|
|
with_items: "{{ wh_docker }}"
|
|
|
|
file:
|
|
|
|
path: "{{ wh_docker_root_dir }}/conf/{{ item.wh_docker_name }}"
|
|
|
|
state: directory
|
|
|
|
owner: bin
|
|
|
|
group: wheel
|
|
|
|
mode: '0644'
|
|
|
|
|
|
|
|
- name: Deploy docker-compose YML file
|
|
|
|
with_items: "{{ wh_docker }}"
|
|
|
|
template:
|
|
|
|
src: docker-compose.j2
|
|
|
|
dest: "{{ wh_docker_root_dir }}/conf/{{ item.wh_docker_name }}/docker-compose.yml"
|
|
|
|
owner: bin
|
|
|
|
group: wheel
|
|
|
|
mode: '0644'
|
|
|
|
|
|
|
|
- name: Restart Docker # Unfortunately, this is necessary, we need to improve the functioning of iptable before
|
|
|
|
service: name=docker state=restarted
|
|
|
|
|
|
|
|
- name: Launch containers
|
|
|
|
with_items: "{{ wh_docker }}"
|
|
|
|
command: "docker-compose -f {{ wh_docker_root_dir }}/conf/{{ item.wh_docker_name }}/docker-compose.yml up -d"
|
|
|
|
|
|
|
|
# - name: Send an welcome email message
|
|
|
|
# TODO
|