From f09e41d662ecbc7b6af713ce696de98f148ec7b0 Mon Sep 17 00:00:00 2001 From: IronicBadger Date: Thu, 1 Oct 2020 19:42:59 -0400 Subject: [PATCH] added support for devices --- templates/docker-compose.yml.j2 | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index ea72ece..2aec72f 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -19,6 +19,17 @@ services: {% if container.privileged is defined %} privileged: {{ container.privileged }} {% endif %} +{% if container.cap_add is defined %} + cap_add: +{% for cap in container.cap_add %} + - {{ cap }} +{% endfor %} +{% endif %} +{% if container.devices is defined %} + devices: +{% for device in container.devices %} + - {{ device }} +{% endfor %} {% if container.volumes is defined %} volumes: {% for volume in container.volumes %} @@ -65,12 +76,6 @@ services: {% if container.restart is defined %} restart: {{ container.restart }} {% endif %} -{% if container.cap_add is defined %} - cap_add: -{% for cap in container.cap_add %} - - {{ cap }} -{% endfor %} -{% endif %} {% if container.command is defined %} command: {% for command in container.command %}