...
 
Commits (2)
......@@ -113,20 +113,35 @@
environment:
DOCKER_CONFIG: '{{ ansible_user_dir + "/" + project }}/.docker'
docker_compose:
definition: '{{ compose_content|yaml_load if project is defined else None }}'
definition: '{{ compose_content|yaml_load }}'
project_name: '{{ project }}'
restarted: true
build: '{{ build|default("no") }}'
state: '{{ state|default("present") }}'
- name: Restart stack
when: stack is defined
- name: Restart persistent stack
when: stack is defined and seconds is not defined
docker_stack:
state: present
name: '{{ stack }}'
prune: yes
compose:
- '{{ compose_content|yaml_load }}'
- name: Restart ephemeral stack
when: stack is defined and seconds is defined
docker_stack:
state: present
name: '{{ stack }}'
prune: yes
compose:
- '{{ compose_content|yaml_load if project is defined else None }}'
- '{{ compose_content|yaml_load }}'
- version: '3'
services:
destroy:
command: bash -euxc "sleep {{ seconds }} && docker stack rm {{ stack }}"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- name: Show logs
shell: docker-compose {% if project is defined %}-f - -p {{ project }}{% endif %} logs
......