feat(template): add support for simple string flags
All checks were successful
test / Linting (push) Successful in 9s
All checks were successful
test / Linting (push) Successful in 9s
This commit is contained in:
parent
84aac3e716
commit
2c275b9f1c
@ -5,6 +5,7 @@ docker_systemd_service_container_env: {}
|
|||||||
docker_systemd_service_container_pull_image: true
|
docker_systemd_service_container_pull_image: true
|
||||||
docker_systemd_service_container_pull_force_source: false
|
docker_systemd_service_container_pull_force_source: false
|
||||||
docker_systemd_service_flags:
|
docker_systemd_service_flags:
|
||||||
|
- privileged
|
||||||
- network: host
|
- network: host
|
||||||
- volume:
|
- volume:
|
||||||
- /root:/mnt/volume
|
- /root:/mnt/volume
|
||||||
|
@ -6,15 +6,19 @@
|
|||||||
{% endmacro -%}
|
{% endmacro -%}
|
||||||
|
|
||||||
{%- macro create_docker_flag(item) %}
|
{%- macro create_docker_flag(item) %}
|
||||||
|
{%- if item is mapping %}
|
||||||
{% set key = item.keys() | first %}
|
{% set key = item.keys() | first %}
|
||||||
{% set value = item[key] %}
|
{% set value = item[key] %}
|
||||||
{%- if value is string %}
|
{%- if value is string %}
|
||||||
--{{ key }} {{ value }} \
|
--{{ key }} {{ value }} \
|
||||||
{%- elif value is iterable and value is not string %}
|
{%- elif value is iterable %}
|
||||||
{% for val in value %}
|
{% for val in value %}
|
||||||
--{{ key }} {{ val }} \{% if not loop.last +%}
|
--{{ key }} {{ val }} \{% if not loop.last +%}
|
||||||
{% endif %}{% endfor %}
|
{% endif %}{% endfor %}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
{%- elif item is string %}
|
||||||
|
--{{ item }} \
|
||||||
|
{%- endif -%}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% set service_systemd_options_keys = docker_systemd_service_systemd_options | selectattr("key") | map(attribute="key") | list %}
|
{% set service_systemd_options_keys = docker_systemd_service_systemd_options | selectattr("key") | map(attribute="key") | list %}
|
||||||
|
Loading…
Reference in New Issue
Block a user