feat(template): test the type of data against list to enable passing integers or strings or lists
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
2c275b9f1c
commit
b466741102
@ -10,6 +10,9 @@ docker_systemd_service_flags:
|
|||||||
- volume:
|
- volume:
|
||||||
- /root:/mnt/volume
|
- /root:/mnt/volume
|
||||||
- /var:/test:ro
|
- /var:/test:ro
|
||||||
|
- health-cmd: curl localhost:80
|
||||||
|
- health-retries: 10
|
||||||
|
|
||||||
docker_systemd_service_container_cmd: []
|
docker_systemd_service_container_cmd: []
|
||||||
#! TO REPLACE
|
#! TO REPLACE
|
||||||
docker_systemd_service_container_labels: []
|
docker_systemd_service_container_labels: []
|
||||||
|
@ -9,13 +9,13 @@
|
|||||||
{%- if item is mapping %}
|
{%- 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.__class__.__name__ == 'list' %}
|
||||||
--{{ key }} {{ value }} \
|
|
||||||
{%- 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 -%}
|
{%- else %}
|
||||||
|
--{{ key }} "{{ value }}" \
|
||||||
|
{%- endif %}
|
||||||
{%- elif item is string %}
|
{%- elif item is string %}
|
||||||
--{{ item }} \
|
--{{ item }} \
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
Loading…
Reference in New Issue
Block a user