mirror of
https://github.com/luzifer-ansible/docker-compose.git
synced 2024-11-08 13:39:59 +00:00
Add docker-wrapper method for docker-compose
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
bea851e179
commit
a68be104dc
3 changed files with 27 additions and 0 deletions
|
@ -5,6 +5,7 @@ docker_compose_stop_action: down
|
|||
docker_compose_validate: true
|
||||
docker_compose_reload_max_delay: 0 # Have no delay, should be less than docker_compose_reload_minutes
|
||||
|
||||
docker_compose_use_docker_image: false
|
||||
docker_compose_add_cleanjob: false
|
||||
|
||||
docker_compose_config:
|
||||
|
|
21
tasks/docker-wrapper.yml
Normal file
21
tasks/docker-wrapper.yml
Normal file
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
|
||||
- name: Install wrapper script
|
||||
copy:
|
||||
content: |
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
exec docker run --rm -ti \
|
||||
-v "/var/run/docker.sock:/var/run/docker.sock" \
|
||||
-v "/etc/docker-compose:/etc/docker-compose:ro" \
|
||||
luzifer/docker-compose \
|
||||
"$@"
|
||||
dest: /usr/local/bin/docker-compose
|
||||
group: root
|
||||
mode: '0755'
|
||||
owner: root
|
||||
|
||||
- set_fact: docker_compose_binary_path="/usr/local/bin/docker-compose"
|
||||
|
||||
...
|
|
@ -4,6 +4,11 @@
|
|||
|
||||
- name: "Loading distribution specific instructions for {{ ansible_distribution }}"
|
||||
include: "{{ ansible_distribution }}.yml"
|
||||
when: not docker_compose_use_docker_image
|
||||
|
||||
- name: Install shell wrapper for docker-compose image
|
||||
include: "docker-wrapper.yml"
|
||||
when: docker_compose_use_docker_image
|
||||
|
||||
# Configure docker-compose
|
||||
|
||||
|
|
Loading…
Reference in a new issue