support all docker arguments #2

Merged
lanson merged 10 commits from feature/support-all-docker-args into main 2023-12-10 18:09:49 +00:00
2 changed files with 6 additions and 1 deletions
Showing only changes of commit 2c275b9f1c - Show all commits

View File

@ -5,6 +5,7 @@ docker_systemd_service_container_env: {}
docker_systemd_service_container_pull_image: true
docker_systemd_service_container_pull_force_source: false
docker_systemd_service_flags:
- privileged
- network: host
- volume:
- /root:/mnt/volume

View File

@ -6,15 +6,19 @@
{% endmacro -%}
{%- macro create_docker_flag(item) %}
{%- if item is mapping %}
{% set key = item.keys() | first %}
{% set value = item[key] %}
{%- if value is string %}
--{{ key }} {{ value }} \
{%- elif value is iterable and value is not string %}
{%- elif value is iterable %}
{% for val in value %}
--{{ key }} {{ val }} \{% if not loop.last +%}
{% endif %}{% endfor %}
{% endif -%}
{%- elif item is string %}
--{{ item }} \
{%- endif -%}
{% endmacro %}
{% set service_systemd_options_keys = docker_systemd_service_systemd_options | selectattr("key") | map(attribute="key") | list %}