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: [] diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index f692cfd..6175390 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -104,6 +104,30 @@ services: {% if container.shm_size is defined %} shm_size: {{ container.shm_size }} {% endif %} +{% if container.ulimits is defined %} + 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 %} +{% 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: +{% for item in container.tmpfs %} + - {{ item }} +{% endfor %} +{% endif %} {% if container.dns is defined %} dns: {% for dns_entry in container.dns %} @@ -120,6 +144,12 @@ services: {% endfor %} {% endif %} {% 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 %}