From d2a458c427ad7165528b0831a16237ed60f627e2 Mon Sep 17 00:00:00 2001 From: IronicBadger Date: Wed, 4 May 2022 09:38:59 -0400 Subject: [PATCH 1/6] adds ulimit support --- templates/docker-compose.yml.j2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index 81b46ed..6c867cc 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -104,6 +104,11 @@ services: {% if container.shm_size is defined %} shm_size: {{ container.shm_size }} {% endif %} +{% if container.ulimits is defined %} + nofile: + soft: {{ container.ulimits_soft }} + hard: {{ container.ulimits_hard }} +{% endif %} {% if container.dns is defined %} dns: {% for dns_entry in container.dns %} From abad2c4c044d68089c79ea249096f53c92234af4 Mon Sep 17 00:00:00 2001 From: IronicBadger Date: Wed, 4 May 2022 10:06:34 -0400 Subject: [PATCH 2/6] ulimits implementation --- templates/docker-compose.yml.j2 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index 6c867cc..872396c 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -105,9 +105,16 @@ services: shm_size: {{ container.shm_size }} {% endif %} {% if container.ulimits is defined %} - nofile: - soft: {{ container.ulimits_soft }} - hard: {{ container.ulimits_hard }} + ulimits: +{% if container.ulimits.nproc is defined %} + nproc: {{ container.ulimits.nproc }} +{% endif %} +{% if container.ulimits.nofile is defined %} + nofile: +{% for param, value in container.ulimits.nofile.items() %} + {{ param }}: {{ value }} +{% endfor %} +{% endif %} {% endif %} {% if container.dns is defined %} dns: From b245c469cd51772a56afc4f55df0191614219065 Mon Sep 17 00:00:00 2001 From: IronicBadger Date: Wed, 4 May 2022 11:23:25 -0400 Subject: [PATCH 3/6] adds tmpfs support --- templates/docker-compose.yml.j2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index 872396c..bc60f0f 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -116,6 +116,12 @@ services: {% endfor %} {% endif %} {% endif %} +{% if container.tmpfs is defined %} + tmpfs: +{% for item in container.tmpfs %} + - {{ item }} +{% endfor %} +{% endif %} {% if container.dns is defined %} dns: {% for dns_entry in container.dns %} From ed6a6064c6ae36885679734d76bfa0c58bb0f2cd Mon Sep 17 00:00:00 2001 From: IronicBadger Date: Fri, 6 May 2022 14:02:45 -0400 Subject: [PATCH 4/6] adds memlock to ulimits --- templates/docker-compose.yml.j2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index bc60f0f..5020e1b 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -115,6 +115,12 @@ services: {{ param }}: {{ value }} {% endfor %} {% endif %} +{% if container.ulimits.memlock is defined %} + memlock: +{% for param, value in container.ulimits.memlock.items() %} + {{ param }}: {{ value }} +{% endfor %} +{% endif %} {% endif %} {% if container.tmpfs is defined %} tmpfs: From 0a604f00191e834c8e51e5044ec1390fee99e8d1 Mon Sep 17 00:00:00 2001 From: Solid Rhino Date: Tue, 17 May 2022 12:21:49 +0200 Subject: [PATCH 5/6] Change description for Ansible Galaxy --- meta/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/main.yml b/meta/main.yml index d49fa76..60ff84a 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -2,7 +2,7 @@ galaxy_info: role_name: docker_compose_generator author: Alex Kretzschmar - description: Adds users to a Linux system + description: Create a docker-compose.yml file issue_tracker_url: https://github.com/ironicbadger/ansible-role-create-users/issues license: GPLv2 min_ansible_version: 2.4 @@ -46,4 +46,4 @@ galaxy_info: categories: - system - web -dependencies: [] \ No newline at end of file +dependencies: [] From a15c0f21458855f1a0d1f9aeb9bf3c7663835ed9 Mon Sep 17 00:00:00 2001 From: IronicBadger Date: Wed, 18 May 2022 19:32:29 -0400 Subject: [PATCH 6/6] adds support for external env files --- templates/docker-compose.yml.j2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index 5020e1b..1643d79 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -134,6 +134,12 @@ services: - {{ dns_entry }} {% endfor %} {% endif %} +{% if container.env_file is defined %} + env_file: +{% for envfile in container.env_file %} + - {{ envfile }} +{% endfor %} +{% endif %} {% if container.restart is defined %} restart: {{ container.restart }} {% endif %}