From 902d85f49805488f95f2551765eab41ef9476757 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Mon, 15 Jun 2020 23:54:20 +0200 Subject: [PATCH] fix compose v3 syntax --- defaults/main.yml | 14 ++++++++++---- templates/services/droneci_compose.yml.j2 | 8 +++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index d80134a..d1432f2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -48,10 +48,16 @@ droneci_networks: droneci_networks_applied: - droneci -# @var droneci_memory_limit: $ "_unset_" -# @var droneci_memory_limit:example: $ "512m" -# @var droneci_memory_reservation: $ "_unset_" -# @var droneci_memory_reservation:example: $ "256m" +# @var droneci_docker_resources: $ "_unset_" +# @var droneci_docker_resources:example: > +# droneci_docker_resources: +# limits: +# cpus: "0.50" +# memory: 50M +# reservations: +# cpus: "0.25" +# memory: 20M +# @end droneci_db_type: sqlite droneci_db_server: localhost diff --git a/templates/services/droneci_compose.yml.j2 b/templates/services/droneci_compose.yml.j2 index f12d06a..9947965 100644 --- a/templates/services/droneci_compose.yml.j2 +++ b/templates/services/droneci_compose.yml.j2 @@ -62,11 +62,9 @@ services: {% endif %} - NO_PROXY={{ droneci_no_proxy | join(',') }} - no_proxy={{ droneci_no_proxy | join(',') }} - {% if droneci_memory_limit is defined %} - mem_limit: {{ droneci_memory_limit }} - {% endif %} - {% if droneci_memory_reservation is defined %} - mem_reservation: {{ droneci_memory_reservation }} + {% if droneci_docker_resources is defined %} + resources: + {{ droneci_docker_resources | to_nice_yaml | indent(6) }} {% endif %} {% if droneci_volumes | default([]) | rejectattr("bind") %}